Tree Notes - HolmesJJ/Data-Structures-and-Algorithms GitHub Wiki
Trees are a good way to store, summarize, and search dynamic data.
B-trees are at the heart of every database!
Many problems require storing additional data in a standard data structure.
Useful for summarizing and processing data
Basic methodology:
- Choose underlying data structure (tree, hash table, linked list, stack, etc.)
- Determine additional info needed.
- Modify data structure to maintain additional info when the structure changes. (subject to insert/delete/etc.)
- Develop new operations.
Basic methodology:
- Choose underlying data structure: AVL tree
- Determine additional info needed: Weight of each node
- Maintained info as data structure is modified. Update weights as needed
- Develop new operations using the new info. Select and Rank
https://www.zhihu.com/question/294774611
创建二叉树 avl的时间复杂度?是O(n),最坏达到O(n^2)