Calculating the depth of a binary tree
Not what you're looking for?
10.30.
Use the integers from one to nine to build a nine-node binary search tree with no duplicate data values
(a). Give the possible root node values if the depth of the tree is 4.
(b). Answer part (a) for depths of 5, 6, 7, and 8.
Purchase this Solution
Solution Summary
This solution shows how to calculate the depth of a binary tree. Various configurations of the tree are considered.
Solution Preview
There are several trees that could be formed with the 9 values. Here is an example of one such tree.
5
/
3 7
/ /
2 4 6 8
/
1 9
A tree with depth 4 means that either the left or the right subtree must have a depth of 3 and the other subtree a depth less than or equal to three. So the focus is on how many elements can be in a tree of depth 3. Then when we know that we can pick all of the possible root values that will allow for the proper ...
Purchase this Solution
Free BrainMass Quizzes
Basic Networking Questions
This quiz consists of some basic networking questions.
Java loops
This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.
Word 2010: Table of Contents
Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.
Javscript Basics
Quiz on basics of javascript programming language.
C# variables and classes
This quiz contains questions about C# classes and variables.