Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 1 ( a, b, c, d and e) Please help me with this Question 1.. Please do answer all (a, b, c, d and
Question 1 ( a, b, c, d and e)
Please help me with this Question 1.. Please do answer all (a, b, c, d and e) . Clear steps and explanations needed for all sub questions. Tq
a. Build a Binary Search Tree for the following sequence of numbers. 45, 36, 76, 23, 89, 115, 98, 39, 41 (5 marks) b. Represent the following expression using a tree: (a-b)/((c*d)+e) (5 marks) c. What is the order of nodes visited for the tree illustrated in Figure 5, by using: i) Pre-Order Traversal ii) In-Order Traversal (5 marks) B D E 7/14 F H Figure 5: Tree The following array represents a heap. [0] [1] [2] [3] [5] [6] [7] [8] [9] 22 18 10 9 7 6 5 5 5 3 9 1 1 i) Identify the left child, right child and parent of node 10 using formula, (5 marks) ii) Draw the binary tree that represents the heap. (5 marks) Repair the broken heap as shown in figure 6 to fulfil the max-heap properties. Draw each step of the reheap-up process. (5 marks) 52 19 33 17 18 (21 30 12 14 10 22 Figure 6: Broken heap
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