摘要:
二叉平衡查找树即是一棵树中所有节点的左右子树高度差不超过1的查找树头文件——————————————————————————————#ifndef _AVLTREE_H_#define _AVLTREE_H_#include #include #include typedefstructAvlNode *Position;typedefPosition AvlTree;#define Element intstructAvlNode{Element data;intheight;//叶子节点高度定义为0,其父节点为1以此类推AvlTree left;AvlTree right;};static 阅读全文
摘要:
#include #include using namespace std;typedef struct tagStudentInfo{int nID;string strName;bool operator setS;sInfo stuInfo;stuInfo.nID = 10;stuInfo.strName = "test1";setS.insert(stuInfo);stuInfo.nID = 20;stuInfo.strName = "test2";setS.insert(stuInfo);set::iterator sIter;for(sIte 阅读全文
摘要:
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657(1)使用set/multiset之前必须包含头文件:#include(2)namespacestd{template,classAllocator = allocator >classset; template,classAllocator = allocator >classmultiset; }只要是assignable、copyable、comparable的型别T都 阅读全文