随笔分类 - 二叉树 算法
手把手教你写平衡二叉树
摘要:AVL树平衡二叉树数据结构AVL树是最先发明的自平衡二叉查找算法,是平衡二叉树的一种。在AVL中任何节点的两个儿子子树的高度最大差别为1,所以它又被成为高度平衡树。查找、插入和删除在平均和最坏情况下都是O(log n)。增加和删除可能需要通过一次或多次树旋转来平衡这棵...
阅读全文
CodeForces - 505B Mr. Kitayuta's Colorful Graph(二维并查集。。)
摘要:Mr. Kitayuta has just bought an undirected graph consisting of n vertices and medges. The vertices of the graph are numbered from 1 to...
阅读全文
POJ-2255 Tree Recovery
摘要:Little Valentine liked playing with binary trees very much. Her favorite game was constructing randomly looking binary trees with capi...
阅读全文