teach-ict.com logo

THE education site for computer science and ICT

1. Introduction to Trees

In the data structures we have discussed so far, no one piece of data is more important than another. Stacks and queues limit access to all but one or two items, but overall each item simply points to the next in line.

The tree data structure is different. Trees use hierarchy to organise data, with data in lower 'branches' connected to data above and below.

For example, biology organises species using a 'tree of life' to show how they are related.

Here, LION and TIGER are subsets of PANTHERA, which is a subset of CARNIVORA, which is a subset of the MAMMALS group.

Trees are useful tools in that they allow for easy searching on the data they contain. Database systems make extensive use of trees to index their data.

Tree is a specific type of the more general graph data structure. We have a full section on graph here.

Challenge see if you can find out one extra fact on this topic that we haven't already told you

Click on this link: uses of tree