Question: 16. Consider the algorithm described in class for inserting a new key into a red-black tree. What is the newly-inserted node colored? A) Black B)
16. Consider the algorithm described in class for inserting a new key into a red-black tree. What is the newly-inserted node colored? A) Black B) Red C) Double Black D) Undetermined E) Red-and-Black and then be determined by its parent node 17. Which sorting algorithm can be used to sort an array in place? A) Merge Sort B) Counting Sort C) Heap Sort D) Radix Sort E) Bucket Sort 18.Consider sorting an array of length 10. Which algorithm would you recommend to implement to sort this array efficiently? A) Quick Sort B) Merge Sort C) Heap Sort D) Bucket Sort E) Selection Sort 19. Which of the following statements is false? A) 0(3n +2n + 7) is the same as O(n) B) O(log (n') is the same as o(log n) C) Ifyou try to access the value ofan unitialized Integer field in an object x of class A, a null pointer exception will be thrown. D) Insertion Sort makes no more than O(n log(n)) pairwise comparisons E) HeapSort has worst-case time complexity of O(n log(n). 10. When it would be optimal to prefer Red-black trees over AVL trees (a Balanced Tree)? A) when there are more insertions or deletions B) when more search is needed C) when tree must be balanced D) when log(nodes) time complexity is needed E) All of the above 111. Which of following is not one of the characteristics of a "good" hash function? A) Computation is fast B) It minimizes collisions C) It should be uniform. D) Run time is O(1) for a deletion E) The formula is easy
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
