

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!


This assignment assumes that you have written binary tree routines. If it has been several years since you took CS2, you will need to get started immediately.
A general tree is a tree in which the number of children is not restricted to two. The problem with a general tree is that if we use an array to store the children pointers, we need to know a maximum number of children.
A more flexible solution (and one that requires less pointer space) stores the tree as a “left most child” and “next right sibling”. Instead of storing pointers to all children, a node only stores a pointer to it’s leftmost child. That child will store a pointer to its next right sibling. See the example below.
For this assignment, you are to complete the following:
level. The above tree would look like: t a e b f g h o p c i d j k q r s l m n