534 Programming and Data Structures
Tree without extension Tree with extension
Fig. 15.6 Extended binary tree
The extended nodes are indicated by square box. Maximum nodes in the binary tree have one son
(nodes) shown at either left or right. By adding one or more sons, the tree can be extended. The
extended binary tree is very useful for representation of algebraic expressions. The left and right sons
denote operands and father indicates operators.
15.4 BINARY TREE REPRESENTATION
Like a list, a binary tree can be implemented by two ways.
1) Static implementation using arrays
2) Dynamic implementation using pointers (linked list)
Linked representation: Recall that the node of a binary tree has three members, one is data variable
and the other two are pointers. The second pointer member points to the left son and the third pointer
member to the right son. The tree representation and the linked tree representation are shown in
Fig. 15.7.
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.227.111.197