There are many sorting algorithms based on comparison. The running time of heapsort O(n lg n) P Q algorithm is . Like , but unlike , (P, Q) heapsort sorts in place where is equal to
Pick an option to check yourself, or open the answer below.
Show answer & explanation
Correct answer: D. Insertion sort, Merge sort
Explanation
Heapsort sorts in place like insertion sort, unlike merge sort, which needs extra memory.
More Data Structures and Algorithms questions
- Which of the following is best running time to n n2 − 1 sort integers in the range 0 to ?
- Which of the following is application of depth- first search?
- Consider double hashing of the form h(k, i) = (h (k) + ih (k)) mod m 1 2 h (k) = k mod m where 1 h (k) = 1 + (k mod n) 2 n = m − 1 m = 701…
- Consider the complexity class as the ¯¯¯ L ∈ NP set of languages L such that , and the following two statements : S : P ⊆ CO − NP 1 S NP ≠…
- Consider the following steps : S 1 : Characterize the structure of an optimal solution S 2 : Compute the value of an optimal solution in bo…
- Consider the following properties with respect to G = (V , E) a flow network in which a flow is a f : V × V → R real-valued function : P :…