
树
wx_14678
一代人终将老去,但总有人正年轻
展开
-
树的旋转和AVL树
AVL树是一种自平衡二叉搜索树,由. M. Adelson-Velsky和E. M. Landis,在他们1962年的论文《An algorithm for the organization of information》中发表。名声很大,就算自己没写过,也应该都听说过。这两天也是重新看了一下,记录一些理解。 1. AVL树简介 AVL树首先是一个二叉搜索树,然后AVL树中任何两个子树的高度差...原创 2019-11-30 21:54:46 · 315 阅读 · 1 评论 -
leetcode题集:559. Maximum Depth of N-ary Tree
最近开始刷leetcode,博客以作记录。 第一天:559. Maximum Depth of N-ary Tree 给定树的数据结构定义: /* // Definition for a Node. class Node { public: int val; vector<Node*> children; Node() {} Node(i...原创 2019-03-19 21:54:13 · 228 阅读 · 0 评论