Contact Us
Projects | Assignments
sellfycode@gmail.com
More
Get Homework Help
English
Español
Português
Français
Deutsch
Italiano
Русский
close
Contact Us
Projects | Assignments
sellfycode@gmail.com
Starting from:
$15
Add to cart
Program to input twenty integers into a tree
Using the tree program, write a program to input twenty integers into a tree.
The program should print out the inorder, preorder and postorder traversals for the tree indicating the LEVEL of each node as it is printed out.
In addition to that there should be statements indicating :
The number of leaves in the tree
The number of nodes with only one child
The number of nodes with two children
The maximum and minimum leaf levels
The height of the tree
Also indicate if the tree is balanced
For Example…if you entered the values
45
3
66
7
8
99
23
11
44
55
6
2
88
9
0
32
14
103
92
The tree program I gave you would print out that the root is 45, that 3 is the left of 45,
66 is the right of 45, etc etc…
It would then do the inorder traversal:
0 (level 3)
2 (level2)
3 (level1)
6 (level 3)
etc
Then you would say (not necessarily correct) something like:
There are 8 leaf nodes
There are 4 nodes with one child
There are 7 nodes with two children
Maximum leaf level = 6
Maximum leaf level = 3
not balanced...height = 6
Starting from:
$15
Add to cart
1 file (1.4KB)
More products
Chapter 13 Exercises Solution
$20
Add to cart
CIS 1111 Programming Topic 10 – Restaurant Functions Solution
$15
Add to cart
S10 Flowgorithm Assignment / Chapter 9: Sorting and Searching Arrays Solution
$20
Add to cart