Tree Structure for Binary Search
Each node defines a search interval.
Root is [0,n-1]
Node defining interval [i,j] has children with intervals [i,k-1] and [k+1,j] where k = (i+j)/2.
A node defining interval [i,j] has key stored at index (i+j)/2.
1
4
5
8
9
10
14
0 1 2 3 4 5 6
1
4
5
8
9
10
14
3
1
0
2
4
6
5
Previous slide
Next slide
Back to first slide
View graphic version