摘要: 用C的思想来写的二叉排序树。在QtCreate+win7上编译通过头文件View Code 1 #ifndef BSTree_H 2 #define BSTree_H 3 //BSTree.h 4 #define SUC 1 5 #define UNSUC 0 6 7 #include <stdlib.h> 8 #include <cstdio> 9 typedef int KeyType;10 //还有另一种结构,带指向父节点的指针,编写方法时更简单,但存储耗费更大11 struct BSTNode{12 struct BSTNode* Lchild;13 struc 阅读全文
posted @ 2013-03-15 15:33 WINSTON-DEAN 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 头文件View Code 1 #ifndef AVLTREE_H 2 #define AVLTREE_H 3 4 #define SUC 1 5 #define UNSUC 0 6 7 #include <stdlib.h> 8 #include <cstdio> 9 typedef int KeyType;10 /*还有另一种结构,带指向父节点的指针,编写方法时更简单,但存储耗费更大*/11 struct AVLNode{12 struct AVLNode* Lchild;13 struct AVLNode* Rchild;14 KeyType m_KType... 阅读全文
posted @ 2013-03-15 15:13 WINSTON-DEAN 阅读(40) 评论(0) 推荐(0) 编辑