Page 1 of 1

Question 4 You are given an array: 10, 4, 12, 3, 5, 11 a. show all the comparisons needed if you were to search for 19 i

Posted: Fri May 20, 2022 4:51 pm
by answerhappygod
Question 4 You Are Given An Array 10 4 12 3 5 11 A Show All The Comparisons Needed If You Were To Search For 19 I 1
Question 4 You Are Given An Array 10 4 12 3 5 11 A Show All The Comparisons Needed If You Were To Search For 19 I 1 (72.9 KiB) Viewed 39 times
Question 4 You are given an array: 10, 4, 12, 3, 5, 11 a. show all the comparisons needed if you were to search for 19 if the above array is representing a BST b. Explain why BST sometimes can have better performance than doing search in a linked list (Use searching 19 in the sequence as an example. Illustrate how many comparisons each approach needs) Please start a new line for each subquestion and mark your answer for each subquestion with the question number in the front. For example: a. X vs. Y b. Explanation Selected Answer: [None Given) Question 5 When doing HeapSort, must be used to put 27, 88, 18, and 33 into descending order. Selected Answer: MinHeap Answers MinHeap Both MinHeap and MaxHeap can be used Neither MinHeap nor MaxHeap can be used MaxHeap Question 6 Read the algorithm below: Algorithm getMystery(Root) left = 0; right = 0; if (Root.left = null) left = getMystery(Root.left): if (Root.right = null) right = getMystery(Root.right); return 1+ Max(left, right); Assume Root is the root of a binary tree. "Max" is a method that find the maximum value in the parameters. What is the general functionality of the algorithm getMystery? Selected Answer: [None Given]