- 博客(3)
- 资源 (1)
- 收藏
- 关注
转载 二叉树非递归遍历,重构
//非递归前序遍历typedef struct btnode{ char data; struct btnode *lchild; struct btnode *rchild; }btnode; typedef struct seqstack{ btnode *stack_p[SIZE]; //store pointers of stack
2017-02-19 16:58:56 358
原创 二叉树的生成和递归遍历
1.遍历时要注意判断递归结束的条件if(T) 2.临时节点变量创建是否成功判断 #include #include #include using namespace std; typedef struct btnode{ char data; struct btnode *lchild; struct btnode *rchild; }btnode; voi
2017-02-17 16:45:58 481
原创 二维数组中的查找
在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。 二分查找,复杂度nlogn bool Find(vector> array1, int target) { int rowCount,colCount; int mid=0; rowCount
2017-02-17 10:38:35 151
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人