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

The number of elements that can be stored
in Θ(log n) time using heap sort is

A
Θ(log nlog log n)
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
Θ(1)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Θ(log n)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Θ(log n)
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A Θ(log nlog log n)
If we have an array of x elements then time complexity to sort x elements using heap sort is

Θ(x log x)

We need to find value of x so that time complexity to sort x elements gets

Θ(log n)

we can direct discard option (a) and (d).

Now check option (c)

=Θ(log nlog log nlog(log nlog log n))

=Θ(log nlog log n(log log nlog log log n))

=Θ(log n(log log n log log log log nlog log n))

=Θ(log n)

flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Cartesian Product
MATHEMATICS
Watch in App
Join BYJU'S Learning Program
CrossIcon