Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Slides
Recent questions tagged binary-heap
7
votes
2
answers
181
ISRO-DEC2017-45
Match the following and choose the correct answer in the order $A, B,C$ ... be asymptotically tight) $a-q,b- r, c-p$ $a-p, b-q, c-r$ $a-q, b-p, c-r$ $a-r, b-q, c-p$
Match the following and choose the correct answer in the order $A, B,C$$\begin{array}{|ll|ll|} \hline \text{A.} & \text{Heap Construction} & \text{p.} & O(n\log n) \\\hli...
gatecse
2.0k
views
gatecse
asked
Dec 17, 2017
DS
isrodec2017
binary-heap
data-structures
+
–
1
votes
1
answer
182
Heap Deletion
For searching an element from heap,then delete it from heap Why will it take O(n+log n) time and not O(n log n) time?
For searching an element from heap,then delete it from heapWhy will it take O(n+log n) time and not O(n log n) time?
srestha
522
views
srestha
asked
Dec 8, 2017
DS
data-structures
binary-heap
time-complexity
+
–
7
votes
2
answers
183
Heaps
From an array of size n , we need to find the k bigger elements. What is the data structure we should use to find k bigger element in best asymptotic complexity? 1.A max heap of size n. 2. A max heap of size k. 3. A min heap of size n. 4.A min heap of size k.
From an array of size n , we need to find the k bigger elements. What is the data structure we should use to find k bigger element in best asymptotic complexity? 1.A max ...
Warlock lord
1.2k
views
Warlock lord
asked
Dec 5, 2017
Algorithms
binary-heap
algorithms
data-structures
+
–
0
votes
1
answer
184
data structure
to find the maximum elements in a min heap represnted by an array can be computed in ____________ time a. theta n b.theta n2 c.theta nlogn d.theta 1
to find the maximum elements in a min heap represnted by an array can be computed in ____________ timea. theta nb.theta n2c.theta nlognd.theta 1
akankshadewangan24
319
views
akankshadewangan24
asked
Dec 2, 2017
DS
data-structures
binary-heap
time-complexity
+
–
2
votes
0
answers
185
HEAP and its properties
Show that there are at most (n/2^h+1) nodes of height h in any n-element heap.
Show that there are at most (n/2^h+1) nodes of height h in any n-element heap.
dragonball
281
views
dragonball
asked
Nov 10, 2017
Algorithms
algorithms
binary-heap
+
–
2
votes
0
answers
186
Worst case running time of MAX_HEAPIFY
Show that the worst case time complexity of MAX_HEAPIFY is Ω(logn ) .
Show that the worst case time complexity of MAX_HEAPIFY is Ω(logn ) .
dragonball
215
views
dragonball
asked
Nov 10, 2017
Algorithms
algorithms
binary-heap
+
–
1
votes
0
answers
187
Time Complexity of Max_heapify(A,i) (CLR 3rd edition Page no. 155)
The running time of MAX_HEAPIFY on a subtree of size n rooted at a given node i is the Thete(1) time to fix up the relationships among the element A[i] , A[LEFT(i)] and A[RIGHT(i)] , plus the time to run the ... MAX_HEAPIFY by the recurrence - T(n) <= T(2n/3) + theta(1) Could anyone explain the bold lines in detail ?
The running time of MAX_HEAPIFY on a subtree of size n rooted at a given node i is the Thete(1) time to fix up the relationships among the element A[i] , A[LEFT(i)] and A...
dragonball
334
views
dragonball
asked
Nov 10, 2017
Algorithms
algorithms
binary-heap
+
–
5
votes
1
answer
188
Heap - Please explain first statement
ankitgupta.1729
853
views
ankitgupta.1729
asked
Nov 9, 2017
DS
data-structures
binary-heap
test-series
time-complexity
+
–
0
votes
1
answer
189
Cormen Exercise
Why do we want the loop index i in Line 2 of BUILD_MAX_HEAP to decrease from ceil(A.length/2) to 1 rather than increase from 1 to ceil(A.length/2) ?
Why do we want the loop index i in Line 2 of BUILD_MAX_HEAP to decrease from ceil(A.length/2) to 1 rather than increase from 1 to ceil(A.length/2) ?
Ashwani Kumar 2
488
views
Ashwani Kumar 2
asked
Nov 8, 2017
DS
data-structures
binary-heap
cormen
descriptive
+
–
1
votes
1
answer
190
MadeEasy Subject Test: Programming & DS - Heap
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________.
sunaina rawat
807
views
sunaina rawat
asked
Nov 7, 2017
DS
made-easy-test-series
data-structures
binary-heap
+
–
2
votes
3
answers
191
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 ________.
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 ________.
shivangi5
3.2k
views
shivangi5
asked
Nov 7, 2017
DS
binary-heap
data-structures
+
–
1
votes
1
answer
192
time complexity
To find the kth smallest element in the heap , the time required is O(n), where k is less than the number of element in the heap. is this statement true should not it be O(klogn)
To find the kth smallest element in the heap , the time required is O(n), where k is less than the number of element in the heap. is this statement true should not it be ...
Kaluti
324
views
Kaluti
asked
Nov 6, 2017
DS
data-structures
binary-heap
time-complexity
+
–
1
votes
1
answer
193
UGC NET CSE | November 2017 | Part 3 | Question: 20
Heap allocation is required for languages that Use dynamic scope rules Support dynamic data structures Support recursion Support recursion and dynamic data structures
Heap allocation is required for languages thatUse dynamic scope rulesSupport dynamic data structuresSupport recursionSupport recursion and dynamic data structures
Arjun
574
views
Arjun
asked
Nov 5, 2017
DS
ugcnetcse-nov2017-paper3
data-structures
binary-heap
+
–
6
votes
2
answers
194
Min Heap
In a min-heap, the next largest element of a particular element can be found in ___ time. A) O(1) B) O(log n) C) O(n)
In a min-heap, the next largest element of a particular element can be found in ___ time.A) O(1)B) O(log n)C) O(n)
Shivam Chauhan
5.1k
views
Shivam Chauhan
asked
Oct 31, 2017
DS
data-structures
binary-heap
time-complexity
+
–
0
votes
0
answers
195
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???
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 ...
Shubhanshu
1.6k
views
Shubhanshu
asked
Oct 18, 2017
Programming in C
binary-heap
time-complexity
algorithms
+
–
0
votes
1
answer
196
time complexity
time taken to delete a node from min heap if you know the value but not position To find the position of the number in min heap should not be log(n) why is it so O(n)
time taken to delete a node from min heap if you know the value but not positionTo find the position of the number in min heap should not be log(n)why is it so O(n)
Kaluti
457
views
Kaluti
asked
Oct 14, 2017
DS
data-structures
binary-heap
time-complexity
+
–
0
votes
2
answers
197
UGC NET CSE | December 2008 | Part 2 | Question: 33
In a heap, every element is ___________ of all the elements in the subtree. maximum minimum sum product
In a heap, every element is ___________ of all the elements in the subtree.maximum minimum sum product
rishu_darkshadow
1.3k
views
rishu_darkshadow
asked
Sep 26, 2017
DS
ugcnetcse-dec2008-paper2
data-structures
binary-heap
+
–
1
votes
1
answer
198
MAX-HEAP increase key procedure
In the max heap Increase key procedure IncreaseKey(int pos, int newValue) { heap[pos] = newValue; while(left(pos) < heap.Length) { int smallest = left(pos); if(heap[right(pos)] < heap[left(pos)]) smallest = right(pos); if(heap[ ... property is violated at a node x, we dont call MAX-HEAPIFY procedure to mend the Max-heap property, What is the reason behind it?
In the max heap Increase key procedureIncreaseKey(int pos, int newValue) { heap[pos] = newValue; while(left(pos) < heap.Length) { int smallest = left(pos); if(heap[right(...
vivek9837
1.6k
views
vivek9837
asked
Sep 14, 2017
DS
data-structures
binary-heap
descriptive
+
–
0
votes
1
answer
199
cormen page 157-159
While proving that the running time of the BUILD-MAX-HEAP 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?
While proving that the running time of the BUILD-MAX-HEAP 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...
Warlock lord
315
views
Warlock lord
asked
Sep 10, 2017
DS
data-structures
binary-heap
+
–
2
votes
1
answer
200
cormen (self doubt)(heap tree)
The children’s subtrees each have size at most 2n=3—the worst case occurs when the bottom level of the tree is exactly half full—and therefore we can describe the running time of MAX-HEAPIFY by the recurrence T (n) =T (2n/3) + constant thats is the equation of max hepify but i dont understand the how it is divided in (2n/3). plz explain
The children’s subtrees each have size at most 2n=3—the worst case occurs whenthe bottom level of the tree is exactly half full—and therefore we can describe therun...
arch
1.0k
views
arch
asked
Aug 25, 2017
DS
data-structures
binary-heap
recurrence-relation
+
–
1
votes
1
answer
201
made easy test series
vipul verma
1.1k
views
vipul verma
asked
Aug 23, 2017
Programming in C
data-structures
binary-search-tree
binary-heap
made-easy-test-series
+
–
8
votes
2
answers
202
Please solve this Q
Construct the Max Heap assuming the following set of integers were inserted into it in given order 20, 32, 1, 3, 4, 5, 6, 7, 10, 23, 45 Postorder traversal of the resultant max heap was stored in a array A with an index variable inorder (Starting from 0) ... values from A and B were obtained and |i - j| is calculated. What could be the maximum possible value for |i - j|?
Construct the Max Heap assuming the following set of integers were inserted into it in given order ...
kallu singh
2.7k
views
kallu singh
asked
Aug 20, 2017
DS
data-structures
binary-heap
numerical-answers
+
–
2
votes
0
answers
203
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.
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 ...
bhuv
498
views
bhuv
asked
Jul 5, 2017
Programming in C
algorithms
binary-heap
+
–
4
votes
3
answers
204
Test by Bikram | Mock GATE | Test 4 | Question: 5
The time complexity of the best known algorithm to find $p^{th}$ ${\left ( p<n \right )}$ smallest element from a $minheap$ of $n$ elements is _______. $\Theta\left ( p\log p \right )$ $\Theta\left ( p\log n \right )$ $\Theta\left ( pn \right )$ $\Theta\left ( n\log p \right )$
The time complexity of the best known algorithm to find $p^{th}$ ${\left ( p<n \right )}$ smallest element from a $minheap$ of $n$ elements is _______.$\Theta\left ( p\lo...
Bikram
931
views
Bikram
asked
May 14, 2017
DS
tbb-mockgate-4
time-complexity
binary-heap
+
–
6
votes
1
answer
205
geeksforgeeks
Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks like this: 16 14 15 10 12 27 28 How many heapify operations have been performed on root of heap? (A) 1 (B) 2 (C) 3 or 4 (D) 5 or 6 Answer: (B)
Suppose we are sorting an array of eight integers using heapsort, and we have just finished some heapify (either maxheapify or minheapify) operations. The array now looks...
shraddha_gami
9.6k
views
shraddha_gami
asked
Apr 13, 2017
Algorithms
sorting
binary-heap
heap-sort
+
–
0
votes
1
answer
206
How does memory layout of a program depend on address binding technique?
I have learned that with run-time address binding, the program can be allocated frames in the physical memory non-contiguously. Also, as described here and here, every segment of the program in the logical address space is ... placed together with the rest of the segments or separately just as in the case of run-time binding ?
I have learned that with run-time address binding, the program can be allocated frames in the physical memory non-contiguously. Also, as described here and here, every se...
Aman Vats
1.9k
views
Aman Vats
asked
Mar 27, 2017
Operating System
operating-system
memory-management
binary-heap
stack
compiler-design
virtual-memory
+
–
0
votes
1
answer
207
Test by Bikram | Mock GATE | Test 3 | Question: 47
A binary max-heap is implemented using an array $A$. The contents of $A$ is $\left \{90, 70, 75, 15, 45, 40, 60 \right \}$. The contents of $A\left[3 \right ]$ are increased from $15$ to $100$. What will the contents of $A$ ... $\left \{ 100, 90, 75, 70, 45, 60, 40 \right \}$
A binary max-heap is implemented using an array $A$. The contents of $A$ is $\left \{90, 70, 75, 15, 45, 40, 60 \right \}$. The contents of $A\left[3 \right ]$ are increa...
Bikram
243
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
data-structures
binary-heap
+
–
0
votes
1
answer
208
Test by Bikram | Mock GATE | Test 3 | Question: 3
What feature of heaps allows them to be efficiently implemented using a partially filled array? Heaps are binary search trees. Heaps contain only integer data. Heaps are full binary trees. Heaps are complete binary trees.
What feature of heaps allows them to be efficiently implemented using a partially filled array?Heaps are binary search trees.Heaps contain only integer data.Heaps are ful...
Bikram
304
views
Bikram
asked
Feb 9, 2017
GATE
tbb-mockgate-3
data-structures
binary-heap
+
–
0
votes
2
answers
209
Choose the correct statement about HEAP
I. A heap is always nearly complete tree. II. Worst case complexity of heapify operation is O( log n) III. Worst case complexity of build heap operation is O( n log n) a. I only b. I and II only c. II and III only d. I, II and III
I. A heap is always nearly complete tree.II. Worst case complexity of heapify operation is O( log n)III. Worst case complexity of build heap operation is O( n log n)a. I ...
sh!va
4.2k
views
sh!va
asked
Feb 7, 2017
DS
data-structures
binary-heap
time-complexity
+
–
6
votes
1
answer
210
Gate Practice Question
A binary min-heap contains keys 1,2,3,4.....2047,2048 What is smallest key that can be at leaf node.??
A binary min-heap contains keys 1,2,3,4.....2047,2048What is smallest key that can be at leaf node.??
Ravi_1511
867
views
Ravi_1511
asked
Feb 3, 2017
DS
data-structures
binary-heap
numerical-answers
+
–
Page:
« prev
1
2
3
4
5
6
7
8
9
10
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register