Trees
Tree data structure wiki
Binary Tree
Tree Traversal
Binary Search Tree
AVL Tree
B-Tree
Balanced Search Tree
Simulator
By David Galles
Idea
A searching data structure like Binary Search Tree (BST) but can hold more data inside each node
=> Reduce searching time
Core Mechanism: Maximum degree A positive integer M that indicates:
- Minimum number of children (except root): M/2
- Maximum number of children (including root): M
- Minimum number of elements inside one node: (M/2) - 1
- Maximum number of elements inside one node: M - 1
The minimum number will cause merging
The maximum number will cause splitting
Operations
Revolves around merging splitting nodes.
Insertion: Insert new node at the right leaf, splits current nodes into siblings if there are more elements bounded by the maximum degree.
Recursively check parent nodes if splitting causes them to have more children than the maximum, splitting if necessary.
B+ Tree
Simulator
By David Galles
Idea
B+ Tree is a B-Tree with some extra features
- All data are stored on the leaf level
- Leaf nodes are connected to each other like a linked list
This post is licensed under CC BY 4.0 by the author.
Comments powered by Disqus.