InterviewSolution
Saved Bookmarks
| 1. |
What is the average number of comparisons used to heap sort a random permutation of N distinct items?(a) 2N log N-O(N)(b) 2N log N-O(N log N)(c) 2N log N-O(N log log N)(d) 2N log N-O(log N)I got this question in an interview for job.This question is from Heapsort topic in division Sorting of Data Structures & Algorithms II |
|
Answer» CORRECT answer is (c) 2N log N-O(N log log N) Explanation: According to a theorem, the average NUMBER of COMPARISONS used to heap sort a random PERMUTATION of N distinct items is found to be 2N log N-O(N log log N). |
|