Question: 3. (6 points) Consider the following three algorithms to find the lowest k numbers out of an unsorted array of n numbers. Give the worst-case

3. (6 points) Consider the following three algorithms to find the lowest k numbers out of an unsorted array of n numbers. Give the worst-case order (big ) of each algorithm in terms of k and n. a. Keep a sorted array of the k lowest numbers. As you traverse the given array, if a number is lower than the k th lowest number you have, insert that number into the appropriate place in the array. b. Use merge sort to sort the given array, then just take the first k numbers. c. Create a min heap from the given array, then remove the mink times
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
