The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
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
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions tagged binaryheap
Slides
0
votes
0
answers
1
Finding the minimum element in a Heap
I was going through the heap concept and one question came into my mind what will be the best case time complexity of finding the minimum element in a max heap? Thank you:)
asked
Jan 15
in
DS
by
Nandkishor3939
Active
(
1.2k
points)

134
views
heap
binaryheap
timecomplexity
0
votes
0
answers
2
Madeeasy Max Heap 2019
Please explain the logic behind this shortcut and when to be used?
asked
Jan 13
in
Algorithms
by
Markzuck
Junior
(
643
points)

214
views
heap
datastructure
binaryheap
algorithms
madeeasytestseries
+1
vote
1
answer
3
Deleting a random node from Heap
What is the time complexity of 'deleting any random node from a max or min heap'?
asked
Dec 21, 2018
in
DS
by
Avijit Shaw
(
145
points)

132
views
heap
binaryheap
timecomplexity
datastructure
0
votes
0
answers
4
HeapsGATEdoubt
https://gateoverflow.in/459/gate200847 here if we insert all elements together and then call heapify function then it’ll take O(logn) time. why answer is O(n)?
asked
Dec 4, 2018
in
Algorithms
by
aditi19
Active
(
2.9k
points)

35
views
heap
binaryheap
0
votes
1
answer
5
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
(
1.8k
points)

169
views
algorithms
heap
binaryheap
timecomplexity
sorting
+1
vote
0
answers
6
BINARY MIN HEAP MADE EASY TEST
Consider a binary min heap given below containing integer in [1, 15]. The maximum number of node movement on 5 successive removal of element are ________.
asked
Nov 20, 2018
in
DS
by
codingo1234
Junior
(
687
points)

119
views
min
binaryheap
0
votes
0
answers
7
Max heap when stored in an array is always in sorted order
This question is in CLRS,if we have a max heap it is always in sorted order(descending) order.And by extension if we have min heap the array is sorted in ascending order.Is this true? I have a counter example for ... it an heapified representation or not? If we heapify after deletion and store max deleted element then we get sorted array.
asked
Nov 15, 2018
in
DS
by
sripo
Active
(
2.6k
points)

135
views
sorting
binaryheap
arrays
heap
datastructure
algorithms
0
votes
1
answer
8
How to understand difference between n/2 and log(n) when comes to operations on a binary tree
asked
Nov 8, 2018
in
DS
by
sripo
Active
(
2.6k
points)

78
views
datastructure
binarytree
heap
binaryheap
0
votes
0
answers
9
Advance test algorithms
what i did {$2^{h+1}1=100$} so i found h=6 so max swaps needed would be 6 please check it or tell me if i iam wrong
asked
Oct 23, 2018
in
Programming
by
Prince Sindhiya
Loyal
(
6.3k
points)

50
views
algorithms
binaryheap
0
votes
0
answers
10
No. of comparison in min heap
What is the number of comparisons required to extract 45th element of the min heap?
asked
Sep 10, 2018
in
Algorithms
by
bts1jimin
(
273
points)

158
views
algorithms
heap
binaryheap
timecomplexity
0
votes
1
answer
11
#binary heap
asked
Aug 29, 2018
in
Programming
by
Shubham Aggarwal
Active
(
1.9k
points)

31
views
binaryheap
0
votes
0
answers
12
Heap Sorting
Consider a binary tree, where left and right subtreealready heapified. But we havenot done heapificationfor root yet. Then what is time complexity to convert it in a full heap tree? $A)O(\log n)$ or $o(n)$ $B)\Omega (\log n)$ or $\omega(n)$ $C)\Theta (\log n)$ or $\theta (n)$ $D)\text{None of these}$
asked
Aug 18, 2018
in
DS
by
srestha
Veteran
(
110k
points)

145
views
algorithms
sorting
heap
binaryheap
timecomplexity
0
votes
0
answers
13
#DS Inserting elements into Min Heap?
The number of distinct min heap are possible with keys 1, 2, 3, 4, 5 are ________. I know, there are variance of this question for Max heap and even for Min heap, the answer won't change, but I just wanna know if my technique is right or not. ===== ... any value. > Lastly the right sub tree => 1C1 = 1 Totally  1*4C3*1*2*1 = 8. Is this approach correct?
asked
Jun 24, 2018
in
DS
by
iarnav
Loyal
(
9.7k
points)

105
views
algorithms
binaryheap
heap
datastructure
0
votes
0
answers
14
#DS Min Heaps Possible?
The number of possible minheaps containing each value from {1,1,1,1,1,1,1} exactly once is _______ This is a variance of Gate 2018 question and how will we deal if all values are same?
asked
Jun 24, 2018
in
DS
by
iarnav
Loyal
(
9.7k
points)

61
views
algorithms
binaryheap
datastructure
+2
votes
1
answer
15
Heap DS
A min heap having 1024 distinct elements with keys ranging from 0 to 1023 is stored in array of 1024 indices. The maximum difference between element 512 present at maximum level and minimum level is ________. [Assume root is ... taking maximum level 11 and minimum level 2 __________________________________________________________________________ why minimum level 2, and why it is not 1?
asked
Jun 24, 2018
in
Programming
by
srestha
Veteran
(
110k
points)

370
views
heap
algorithms
binaryheap
datastructure
0
votes
1
answer
16
#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
(
9.7k
points)

86
views
heap
algorithms
binaryheap
0
votes
1
answer
17
#Binary Max Heap Question (Doubt)
Let's say we're given with a MAX Heap and we want to delete any of the leaf node, then how much time will it take to delete any of the leaf node and maintain the max heap property? My main doubt is  will it O(n) time to reach to leaf nodes?
asked
Jun 19, 2018
in
DS
by
iarnav
Loyal
(
9.7k
points)

95
views
binaryheap
heap
+1
vote
0
answers
18
Number of Max Heap
How many maxheaps can be formed with the following elements? $\{1,1,1,2,2,2,3,3,3,4,4,4\}$
asked
Jun 4, 2018
in
DS
by
Balaji Jegan
Loyal
(
5.4k
points)

349
views
datastructure
permutationsandcombinations
binaryheap
heap
0
votes
1
answer
19
Dijkstra Time Complexity using Binary Heap
Question Source  https://gateoverflow.in/1374/gate200538 Let G(V,E)be an undirected graph with positive edge weights. Dijkstra's single source shortest path algorithm can be implemented using the binary heap data structure with time complexity: 1. O(V2) 2. O( ... as I > said the correct answer is O((E+V)logV). So, where am I going > wrong?
asked
May 22, 2018
in
Algorithms
by
iarnav
Loyal
(
9.7k
points)

214
views
algorithms
binaryheap
dijkstrasalgorithm
timecomplexity
heap
0
votes
0
answers
20
Heap DataStructure
A min heap having $1024$ distinct elements with keys ranging from $0$ to $1023$ is stored in array of $1024$ indices. The maximum difference between $(n/2)^{th}$ element present at maximum level and minimum level is ________. [Assume root is present at $level1$] ? Please Tell me the Approach
asked
May 20, 2018
in
Algorithms
by
Na462
Loyal
(
8.7k
points)

54
views
algorithms
binaryheap
0
votes
1
answer
21
Doubt on Heap
How much time will it take for deleting $i^{th}$ and a number $n(random)$ node from a heap ?
asked
Apr 28, 2018
in
Algorithms
by
Akash Kumar Roy
Junior
(
547
points)

107
views
algorithms
binaryheap
0
votes
1
answer
22
Fibnocii heap
what is Potential function in Fibonacci heap (i dont remember the question ) plz explain with example
asked
Mar 30, 2018
in
Algorithms
by
akshat sharma
Active
(
1.9k
points)

77
views
heap
algorithms
binaryheap
0
votes
0
answers
23
Heap Smallest Element
My question is in Question like find 5th Smallest element in a heap: It requires O(logn) time if we do only Delete operation 5 Times.But what if the array contains no 5th smallest element say our array contain [1,1,1,1,1,1,1,1,1,1] now ... need to do extract min operation n number of times which would give nlogn time? Plz Clear my doubt https://gateoverflow.in/1110/gate200323
asked
Feb 17, 2018
in
Algorithms
by
Na462
Loyal
(
8.7k
points)

160
views
heap
binaryheap
algorithms
+3
votes
2
answers
24
Datastructres
The number of distinct max heap are possible with keys 1, 2, 3, 4, 5 are ________.
asked
Jan 20, 2018
in
DS
by
MIRIYALA JEEVAN KUMA
Active
(
2.5k
points)

215
views
binaryheap
heap
algorithms
datastructure
+4
votes
1
answer
25
Max heap no. of interchange required
asked
Jan 7, 2018
in
DS
by
Lakshman Patel RJIT
Boss
(
34.3k
points)

159
views
datastructure
binaryheap
+1
vote
2
answers
26
Max Heap
The number of ways in which the numbers 1, 2, 3, 4, 5 can be inserted into binary heap. Such that resulted binary heap is max heap ________.
asked
Nov 7, 2017
in
DS
by
shivangi5
Active
(
1.4k
points)

423
views
heap
binaryheap
datastructure
+5
votes
2
answers
27
Min Heap
In a minheap, the next largest element of a particular element can be found in ___ time. A) O(1) B) O(log n) C) O(n)
asked
Oct 31, 2017
in
Algorithms
by
Shivam Chauhan
Loyal
(
9.1k
points)

522
views
heap
algorithms
binaryheap
timecomplexity
0
votes
0
answers
28
Data Structure: Find 7th smallest element in Min heap
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) .... ... this solution the data arrangement of the heap will be changed after performing these operation. any better solution than this???
asked
Oct 18, 2017
in
Programming
by
Shubhanshu
Boss
(
19.2k
points)

401
views
heap
binaryheap
timecomplexity
algorithms
0
votes
1
answer
29
cormen page 157159
While proving that the running time of the BUILDMAXHEAP to be O(n) and not O(n lgn), the have considered the number of nodes or elements at some height 'h' to be n/2^(h+1). How? All I know is that 2^h alone can give you number of nodes at some heigh h. I do not understand this. Can someone explain in detail?
asked
Sep 10, 2017
in
Algorithms
by
Warlock lord
Active
(
3.5k
points)

61
views
algorithms
binaryheap
+2
votes
0
answers
30
CLRS Heapsort, number of nodes of height h ?
Number of node of height h in a binary tree is given as ceiling (n/2^(h+1)) from where this formula come ? I've only found proof by induction or solving for a particular case to say it is true. But didn't get what going behind it.
asked
Jul 5, 2017
in
Programming
by
bhuv
Active
(
4.4k
points)

136
views
algorithms
binaryheap
Page:
1
2
next »
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
How to prepare for IISC Interdisciplinary Mathematical Sciences Interview
GO Hardcopy for GATE 2020
How to prepare for BARC interview
IIIT H
Tips for COAP2019
Follow @csegate
Recent questions tagged binaryheap
Recent Blog Comments
What is the cutoff for M.Tech AI at IISc?
Yup. Hard copy contains a unique QR code for...
Lol. I got left out of IIT Kanpur GATE cutoff by...
Don't worry brother... i hope fate is also get...
50,049
questions
53,194
answers
184,528
comments
70,400
users