11 2014 档案
摘要:Ⅰ.说明: 1.采用左孩子右兄弟的方式,转化为二叉树来实现。 2.树的后根遍历与二叉树的中根遍历即有联系又有区别,请读者注意分析体会。Ⅱ.功能: 1.创建树并写入数据 2.先根遍历树 3.计算树高 4.后根遍历树 5.层次遍历树 6.搜索数据域为某值...
阅读全文
摘要:#include #include using namespace std; struct Node { char ch; Node* next; Node(char c, Node* p){ ch = c; next = p; } }; void main() { string str; ...
阅读全文
摘要://.h文件 #ifndef STACK_H #define STACK_H #include #include using namespace std; template //链式栈结点struct L_Node { T data; L_Node* next; L_Node()...
阅读全文
摘要://.h文件 #ifndef TREE_H #define TREE_H #include #include using namespace std; template struct Node //树结点{ T data; Node *left, *right; Node...
阅读全文
摘要:Ⅰ.功能: 1.创建图 2.展示全图 3.添加顶点 4.添加边 5.删除顶点 6.删除边 7.查看指定边权值 8.修改指定边权值 ...
阅读全文
摘要:#include #include #define LEN sizeof(struct Student) struct Student //结构体声明{ long num; int score; struct Student* next; }; int n; s...
阅读全文
摘要:/* 说明: 代码参考过网上代码,但分析为个人原创,本贴重在说明快速排序算法的思想和运行过程。 */ 代码部分: #include<stdio.h> #include<stdlib.h> void quickSort(int* arr,int startPos, int endPos) { int
阅读全文