![](https://img-blog.csdnimg.cn/20201014180756916.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
c/c++学习
文章平均质量分 69
photoed
这个作者很懒,什么都没留下…
展开
-
将二叉查找树转换为有序双链表
#include#includeusing namespace std;/*将二叉查找树如下: 转换为排序双向链表 10 / \ 6 14 / \ / \ 4 8 12 16转换后的双向链表为4=6=8=10=12=14=16转换的思想如下:将二叉查找树种指向左子节点的指针调整为指向前一个结点的指针, 指向右子节原创 2014-08-20 23:10:34 · 470 阅读 · 0 评论 -
自定义栈数据结构,并且实现取出栈中最小元素
Stack.h#includeusing namespace std;const int success = 1;const int overflow = 2;const int underflow = 3;typedef int nodeEntry;struct stackGetMin{ Stack temp; Stack minStack; void push(in原创 2014-08-21 10:27:16 · 377 阅读 · 0 评论 -
二叉树中找出和为给定值得所有路径
#include#include#includeusing namespace std;struct TreeNode{ int data; TreeNode *left; TreeNode *right;};//自定义asiII转int函数int my_atoi(char *p){ int number = 0; if(p == NULL) { cout<<"原创 2014-08-21 15:53:09 · 438 阅读 · 0 评论 -
输入一个整形数组,数组中有正数也有负数,求该数组中所以子数组和的最大值
如输入:1,-2,3,10,-4,7,2,-5和的最大z原创 2014-08-21 11:34:41 · 960 阅读 · 0 评论