Question: A [ ] = { 1 0 . 0 0 , 2 0 . 0 0 , 3 0 . 0 0 , 4 0

A[]={10.00,20.00,30.00,40.00,50.00,60.00,70.00,80.00,90.00,100.00}
You are required to create a complete binary tree (BT)
(balanced) using a class structure in C++. A sample
command line output with float values is on the right.
This non-generic binary tree (BT) should contain 10
elements as seen above A[]. The elements should be
placed in appropriate positions within the tree as shown
in the given diagram. The graph should strictly be like
that of the graph seen on the right-hand side which is a
complete BT.
Requirements:
Use classes, do not use structs.
The tree is NOT a Binary Search Tree.
Use and benefit from the codes given in the course.
The binary tree should be complete, meaning every level should be filled, except possibly for the last level, which should be filled from left to right.
It will be like ReadTree in the lesson, you will create a complete binary tree recursively.
/ and \ values are important. MPORTANT NOTE: THE OUTPUT OF THE CODE MUST BE SIMILAR TO THE IMAGE I ADDED. THE RIGHT AND LEFT BRANCHES THAT WILL BE CREATED WITH THE TREE /\ SLASH SIGNS IN THE OUTPUT ARE THE VALUES THAT WILL BE DISPLAYED WITH THESE SIGNS IF A[]={10.00,20.00,30.00,40.00,50.00,60.00,70.00,80.00,90.00,100.00}
 A[]={10.00,20.00,30.00,40.00,50.00,60.00,70.00,80.00,90.00,100.00} You are required to create a complete binary tree (BT)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!