BST PDF
BST PDF
BST PDF
Binary search trees are binary trees that satisfies the search tree property
that left children are less than or equal to the parent and right children
are greater than the parent. Note that because root choice is arbitrary, the
height of an unbalanced BST can be anywhere from log2 n n, which
means any algorithms operating on binary search trees have to take into
account average-case and worst-case runtimes.
Operation
Select
Search
Min/Max
Pred-/Succ-essor
Rank
Output
Insert
Delete
Time
O(log n)
O(log n)
O(log n)
O(log n)
O(log n)
O(n)
O(log n)
O(log n)
Operations
Minimum
Traverse the tree going left every time until a leaf node.
Maximum
Traverse the tree going right every time until a leaf node.
Deletion
1
11