Autigers.org These questions are from the Exam One of COMP2210-Sp2017 Course at
ID: 3824451 • Letter: A
Question
Autigers.org These questions are from the Exam One of COMP2210-Sp2017 Course at Auburn University. Please Answer them and give a short explanation if necessary. Thanks. www.yifanzhang.cn
The following question are the same but in different server. In case the question are not appeared properly.
Suppose you have collected data from several timing experiments and you have characterized a sorting method's time complexity profile as follows Data in ascending order: O (N log N) Data in descending order: O(N log N) Data in random order: O(N log N) Which sorting algorithm is implemented in this method? A. selection sort B. insertion sort C. merge sort D. quicksort (without randomization)Explanation / Answer
Part A:
We Implemented (C)Merge Sort because Merge Sort Time Complexity is irrespective of the Input , So for the first case its Merge Sort
Part B:
We Implemented (D) Quick Sort because Quick Sort Time Complexity is O(N2) when the data is ascending or descending and O(N log N ) during average.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.