The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
Facebook Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
Blogs
New Blog
Exams
Data Structure: Find 7th smallest element in Min heap
0
votes
445
views
In a binary min heap with n elements, the 7th smallest element can be found in _____ ?
Answer given is O(logn)
and solution:
Delete the 1st smallest element O(logn)
Delete the 2nd smallest element O(logn)
....
Delete the 7th smallest element O(logn).
So in total O(logn).
In this solution the data arrangement of the heap will be changed after performing these operation.
any better solution than this???
heap
binaryheap
timecomplexity
algorithms
asked
Oct 18, 2017
in
Programming
by
Shubhanshu
Boss
(
18.2k
points)

445
views
answer
comment
+6
in min heap, we know that 7th minimum will be present maximum till 7th level, and there will 127 elements till 7th level, so we have to do only constant time comparison, and it will take O(1) time.
0
https://gateoverflow.in/889/gate200610
Please
log in
or
register
to add a comment.
Please
log in
or
register
to answer this question.
0
Answers
← Prev. Qn. in Sub.
Next Qn. in Sub. →
← Prev.
Next →
Related questions
+6
votes
3
answers
1
7th smallest element in a MinHeap
In a minheap with n elements 1). The 7th smallest element can be found in time, if duplicates are allowed ? 2). The 7th distinct smallest element can be found in time, If duplicates are allowed ?
asked
Sep 4, 2016
in
Algorithms
by
Kapil
Veteran
(
50.5k
points)

1.4k
views
algorithms
heap
binaryheap
sorting
timecomplexity
+9
votes
5
answers
2
What is the complexity of finding 50th smallest element in an already constructed binary minheap?
asked
Dec 28, 2014
in
Algorithms
by
Vikrant Singh
Boss
(
13.5k
points)

1.1k
views
algorithms
binaryheap
heap
+1
vote
1
answer
3
Kth Largest element in MinHeap
What is the time complexity to find the Kth largest element in a MinHeap? Or equivalently, What is the time complexity to find Kth smallest element in MaxHeap?
asked
Dec 1, 2018
in
Algorithms
by
gmrishikumar
Active
(
2k
points)

249
views
algorithms
heap
binaryheap
timecomplexity
sorting
0
votes
1
answer
4
#Algorithms Can Heapsort be applied on Min Heap Data Structure?
I've read and been told that Heapsort can only be applied on Max heap, but this article for G4G states otherwise  https://www.geeksforgeeks.org/heapsortfordecreasingorderusingminheap/ So, is it true that HS can be applied also on Min heap?
asked
Jun 20, 2018
in
Algorithms
by
iarnav
Loyal
(
8.2k
points)

108
views
heap
algorithms
binaryheap
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
OFFICIAL GATE MOCK TEST RELEASED
IIITH: Winter Research Admissions 2019 (For Spring 2020)
TIFR and JEST exam
Minimal Deterministic Finite Automata
To be aware of fake GATE test series
All categories
General Aptitude
1.9k
Engineering Mathematics
7.4k
Digital Logic
2.9k
Programming and DS
4.9k
Programming
3.5k
DS
1.3k
Algorithms
4.3k
Theory of Computation
6.2k
Compiler Design
2.1k
Operating System
4.5k
Databases
4.1k
CO and Architecture
3.4k
Computer Networks
4.1k
Non GATE
1.4k
Others
1.7k
Admissions
595
Exam Queries
576
Tier 1 Placement Questions
23
Job Queries
72
Projects
17
Follow @csegate
Recent Blog Comments
@Satbir Its a valuable info..Thanks
It is the 2019 question paper given as a mock...
Favorite is not working for blogs.. In favorites...
Favourite option does work. But list options...
Blog favorite button doesnt work?
50,654
questions
56,169
answers
193,881
comments
94,301
users