Solved

Sorting a Preexisting Sequence of N Elements Can Be Accomplished

Question 52

Multiple Choice

Sorting a preexisting sequence of n elements can be accomplished with the heapsort algorithm by:


A) Calling make_heap on the entire sequence and then calling pop_heap on the entire sequence n times.
B) Calling push_heap on the entire sequence n times and then calling pop_heap on the entire sequence n times.
C) Calling make_heap on the entire sequence and then calling sort_heap on the entire sequence.
D) Calling push_heap on the entire sequence n times and then calling sort_heap on the entire sequence.

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions