摘要: 数据结构定义 typedef struct BiTNode { ElemType data; //数据域 ChildPtr *lchild,*rchild; //左右孩子的指针域 //可以开个指针域指向双亲,变为三叉链表 }BiTNode, *BiTree; 第一种:已知前序遍历、中序遍历求后序遍历 阅读全文
posted @ 2022-03-18 10:53 心悟&&星际 阅读(475) 评论(0) 推荐(0)
摘要: 数据结构定义 typedef struct BITNode{ int data; int bf; int cnt; struct BITNode *lchild,*rchild; }BITNode,*BITree; 左旋 void L_Rotate(BITree &T) { BITree tmp; 阅读全文
posted @ 2022-03-18 10:04 心悟&&星际 阅读(43) 评论(0) 推荐(0)
摘要: 数据结构定义 struct node{ int data;//结点的内容 int left;//左子树 int right;//右子树 int cnt; int size; } Bst[100100]; queue<int> sq; int root=0; int tot=0; 更新子树大小:等于左 阅读全文
posted @ 2022-03-18 09:55 心悟&&星际 阅读(43) 评论(0) 推荐(0)