0% found this document useful (0 votes)
11 views1 page

Tree Traverls.c

Uploaded by

ranganadh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
11 views1 page

Tree Traverls.c

Uploaded by

ranganadh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Linear data structures like arrays, stacks, queues, and linked list have only

one way to read the data. But a hierarchical data structure like a tree can be
traversed in different ways.

Let's think about how we can read the elements of the tree in the image
shown above.

Starting from top, Left to right

1 -> 12 -> 5 -> 6 -> 9

Starting from bottom, Left to right

5 -> 6 -> 12 -> 9 -> 1

Although this process is somewhat easy, it doesn't respect the hierarchy of


the tree, only the depth of the nodes

You might also like