Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 3 Consider the following sequence of numbers 18,20,3,17,28,50,6,55,4,9,1 a) Consruct a binary search tree. Is the tree balanced, balance the tree if it is
Question 3 Consider the following sequence of numbers 18,20,3,17,28,50,6,55,4,9,1 a) Consruct a binary search tree. Is the tree balanced, balance the tree if it is not balanced? (3 Marks) b) Show the contents of the tree using inOrder,preOrder and postOrder traversal algorithms. (3 Marks) Construct a priority queue (min-heap) for for the same sequence of numbers, show the heap after removing the minimum (2 Marks) d) Show the hash table with size 11 using chaining where f(i)=I and hash(x)=x mod 11 (2 Marks) 0 1 2 3 4 5 6 7 8 9 10 le) Write a method that finds the maximum value in a tree. State its complexity (2 Marks) f) Write a method that prints the contents of a tree in Level Order? State the complexity of this code (3 Marks) 4
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