PPT Slide
How can a tree be represented in an array?
Place the root of the tree in element 1 of the array
Place the root’s left child in element 2 (RootPos*2)
Place the root’s right child in element 3 (RootPos*2+1)
1
2
3
4
5
6
7
12
57
87
15
19
44
23
12
Previous slide
Next slide
Back to first slide
View graphic version