Question
Assume that you have a complete tree with 200 nodes, and that you represent it in array form. Node A of the tree is in
Assume that you have a complete tree with 200 nodes, and that you represent it in array form.
Node A of the tree is in position 50 of the array. What are the indices of As left child, right child, and parent? Explain how you got your answers.
What is the height of the tree? Explain your answer briefly.
The bottom level of the tree contains some number of leaf nodes. Is the rightmost leaf node in the bottom level the left child of its parent or the right child of its parent? Explain your answer briefly.
In Problem 6, you will implement a method that determines if the complete tree corresponding to an array of values is a heap. What is the efficiency of determining if an array of length n represents a heap in the best case? In the worst case? Use big-O notation, and explain your answers briefly.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started