- 博客(3)
- 收藏
- 关注
转载 第1题:把二元查找树转变成排序的双向链表
题目: 输入一棵二元查找树,将该二元查找树转换成一个排序的双向链表。 要求不能创建任何新的结点,只调整指针的指向。 10 / \ 6 14 / \ / \ 4 8 12 16 转换成双向链表 4=6=8=10=12=14=16。 #include #include #include #include using namespace std; int findGre
2014-11-29 10:23:08
296
转载 波兰表达式和逆波兰表达式
波兰表达式和逆波兰表达式分别是一颗二叉树的前序遍历和后序遍历。 方法一:递归 #include #include using namespace std; struct Tree { char value; Tree *left; Tree *right; }; void solution_LRD(Tree *head) { if(head) { solut
2014-11-29 10:14:17
804
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅