Data Structures for Trees
An Introduction |
Prof. David Bernstein |
Computer Science Department |
bernstdh@jmu.edu |
An Example
45 | 41 | 42 | 35 | 29 | 38 | 34 | 22 | 11 | 40 | 9 | 18 |
parent(i) = (i - 1) / N
firstChild(i) = (i * N) + 1
lastChild(i) = (i * N) + N