CIS3355: Business Data Structures in C/C++

Dr. Peeter Kirs

 

Binary Trees

Short Answer/Problem Questions

 

NOTE: Checking the answers before you have tried to answer the questions doesn’t help you at all

 

1000. What is a binary tree?

 

            SEE SOLUTION

 

1050. Given the following list of integers:

 

5, 8, 3, 2, 7, 9, 1, 6

 

Show ALL of the steps necessary to set-up the binary tree (assume the first element is the root node)

 

            SEE SOLUTION

 

1060. Show the same binary tree (in question 1050) as it might be constructed in RAM. Assume the following C++ Code is given:

 

struct tree

{     short node;

      struct tree * left, right; };

 

void main()

{     struct tree * first, present, new;

      ∙ ∙∙

}

 

            SEE SOLUTION