wiz-icon
MyQuestionIcon
MyQuestionIcon
1
You visited us 1 times! Enjoying our articles? Unlock Full Access!
Question

Experiments indicate that heap sort requires _____ as much time as quick sort for randomly sorted input.

A
Twice
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
Thrice
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Four times
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Five times
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A Twice

Experiments indicate that heap sort requires twice as much time as quick sort for randomly sorted input.

Heap sort is a comparison based sorting technique based on binary heap data structure. It is similar to selection sort where we first find the maximum element and place the maximum element at the end. We repeat the same process for remaining element.

Quick sortis a highly efficient sorting algorithm and is based on partitioning of array of data into smaller arrays. Quick sort partitions an array and then calls itself recursively twice to sort the two resulting sub arrays.



flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Transportation & Warehousing Services
BUSINESS STUDIES
Watch in App
Join BYJU'S Learning Program
CrossIcon