IN THE NAME OF ALLAH
SEQUENTIAL REPRESTATION OF BINARY TREE IN COMPUTER MEMORY SADAF KALSOOM DATE:4TH APR 2009
Sequential representation of binary tree This type of storage, a binary
This type of storage, a binary tree is firstly Traversed by level by level and then it is stored in an array of nodes.
In
this type of storage, the root node is stored in position 1 while remaining nodes Are stored in following criteria.
First
step is
(a) The root R of ‘T’ is stored in TREE[1]
2nd If
step is
node N occupies Tree[k], then its left child is stored in TREE[2*k], and its right child is stored in TREE[2*k+1].
45 22
Tree Example
11 15 4 51
2 7 1 3 22 73 14 05
77 30
90
25
6
88 9 07
15 8
9
25 1 0
11
12 13 14
8 815
16
Have a nice day!