![](https://img-blog.csdnimg.cn/20201014180756927.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++
程序员修仙之路
程序员
展开
-
建立二叉搜索树,求中序遍历,层序(从头到尾)遍历,镜像
//建立二叉搜索树,求中序遍历,层序(从头到尾)遍历,镜像 #include #include #include #include using namespace std; struct BSTNode { int data; struct BSTNode* lchild; struct BSTNode* rchild; }; //插入二叉搜索树结点 void addBS原创 2012-11-12 22:51:03 · 312 阅读 · 0 评论 -
整数数组0元素后移
题目:如下:int A[nSize],其中隐藏着若干0,其余非0整数,写一个函数int Func(int* A, int nSize),使A把0移至后面,非0整数移至数组前面并保持有序,返回值为原数据中第一个元素为0的下标。(尽可能不使用辅助空间且考虑效率及异常问题,注释规范且给出设计思路)。 #include using namespace std; int Func(int* a, in原创 2013-03-09 18:57:16 · 493 阅读 · 0 评论