happy happy

happy happy

    • 首页
    • 关于
    • 简历
    • 博客

数组中出现次数超过一半的数字

#include <iostream> using namespace std; //是不是有效输入 bool IsValidMatrix(int * matrix,int length){ if(matrix==NULL||length<=0)

2016-05-02

字符串全排列(去重)以及全组合(2^n-1)

//实现字符串每个字符 的全排列,并求取全排列的个数//分为三部分:1.首先,求取所有可能出现在第一个位置的字符;//2.其次,把第一个字符和其后面的字符一一交换;//3.接着,固定第一个字符,求后面所有字符的排列。重复步骤2 //全排列 #include<iostr

2016-05-02

BST转换双向链表

//实现二叉搜索树到双向链表的转换 #include <iostream> #include<queue> using namespace std; struct BinaryTreeNode{ int m_nValue; BinaryTr

2016-05-02

复制复杂链表

//复制复杂链表 #include <iostream> using namespace std; struct ComplexListNode{ int m_nValue; ComplexListNode* m_pNext; Complex

2016-04-30

二叉树中和为给定值的路径

//给定二叉树和一个值,找到二叉树中和等于这个值的路径 #include <iostream> #include<stack> #include<vector> using namespace std; struct BinaryTreeNod

2016-04-30

后序序列可以构成BST?

//判断一个后序序列是不是二叉搜索树的后序遍历序列 //二叉搜索树的左子树<根节点;右子树大于根节点 #include <iostream> using namespace std; bool SequenceIsBST(int *sequence, int len

2016-04-30

按层打印二叉树(广度优先遍历)

//根据先序和中序构建二叉树,然后按层打印每个节点,队列 #include <iostream> #include<queue> #include<exception> using namespace std; struct BinaryTr

2016-04-30

弹入序列 VS 弹出序列

//给定输入序列,判断给定的输出序列是不是真的 #include <iostream> #include<stack> using namespace std; bool IsPopOrder(const int* pPush, const int*

2016-04-30

O(1)找到栈的最小值

//O(1)时间找到栈中最小元素 #include <iostream> #include<stack> #include<assert.h> using namespace std; template <typename T> c

2016-04-30

今日头条

2016-04-27
Prev1…34567Next

友情链接

  • My Github
  • Wxj's Blog
RSS 订阅

新浪微博

Hello ,I'm Wang xiaojing in Tianjin University.
This is my blog, welcome!

Powered by hexo and Theme by Jacman © 2016 王晓静