For processing dynamic lists it has been seen that the linked-list data structure is very useful. It imposes a structure where an element may have a predecessor and a successor. But many natural applications require data structures, which gives the flavour of a hierarchy. This hierarchical nature is not available in the linked data structure that we have studied earlier. However, the data structure, the tree, imposes a hierarchical structure on a collection of elements. In this chapter we will consider trees together with the operations on them and their applications.


A tree consists of a finite collection of elements called nodes or vertices, one of which is distinguished as root, and a finite collection ...

Get Data Structures Using C now with the O’Reilly learning platform.

O’Reilly members experience live online training, plus books, videos, and digital content from nearly 200 publishers.