Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Successfully reported this slideshow.

Like this presentation? Why not share!

- Lecture 8 data structures and algor... by Aakash deep Singhal 4919 views
- Binary tree by Vanitha Chandru 11376 views
- Binary Search Tree in Data Structure by Dharita Chokshi 11284 views
- Trees (data structure) by Trupti Agrawal 7356 views
- Binary tree by Ssankett Negi 8221 views
- Trees data structure by Sumit Gupta 15059 views

25,181 views

Published on

No Downloads

Total views

25,181

On SlideShare

0

From Embeds

0

Number of Embeds

2

Shares

0

Downloads

338

Comments

0

Likes

8

No embeds

No notes for slide

- 1. Representation of Binary treein memoryLet T be a binary.There are two ways for representing binarytree in memory.Sequential RepresentationLinked Representation
- 2. Sequential Representation Suppose T is a complete binary tree. Then only single linear array TREE is used as follows.
- 3. The root R is stored in TREE[0]. If a node n occupies TREE[K], then its left child in TREE[2*K] & right child TREE [2*K+1]. If TREE[1]=NULL then it is empty tree.
- 4. Linked Representation The linked representation uses three parallel arrays,INFO,LEFT & RIGHT & a pointer variable ROOT.Each node N of Y will correspond to a location K such that: 1) INFO[K] contains the data at node N. 2) LEFT[K] contains the location of left child of node N. 3) RIGHT[K] contains the location of right child of node N. ROOT will contain location of root R of T.
- 5. A sample representation is shownin fig.

No public clipboards found for this slide

Be the first to comment