Click on any exercise below to see the source code, program output and explanation of the code. The exercises in this section make use of trees. A tree is a non-empty collection of vertices (nodes) and edges that satisfies certain requirements. A vertex can have a name, as well as carry other information. An edge connects two vertices.
Exercise 7.1. Write a program to read integers, store them in a binary tree, display the content of the tree, deletes the tree and exits. Decide in what order the integers are added to the tree and develop a convenient way for displaying the tree.