Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions tagged heap-sort
0
votes
1
answer
1
ISRO 2024
Worst case time complexity of heap sort for n elements O(nlogn) O(logn) O^2 O(n)
Worst case time complexity of heap sort for n elementsO(nlogn)O(logn)O^2O(n)
Ramayya
197
views
Ramayya
asked
Jan 7
Algorithms
isro-2024
algorithms
heap-sort
sorting
+
–
0
votes
2
answers
2
made easy test series for gate cse 2023
please help me out in solving this question. the solution provided there is not upto the mark
please help me out in solving this question. the solution provided there is not upto the mark
sachidanand_dwivedi
1.1k
views
sachidanand_dwivedi
asked
Dec 21, 2022
Programming in C
data-structures
heap-sort
binary-heap
difficult
made-easy-test-series
+
–
1
votes
2
answers
3
Gate Applied Practice Test
Question--> The time required to find the 99th smallest element from a min heap of n elements is (given that we have access to the array elements)
Question The time required to find the 99th smallest element from a min heap of n elements is (given that we have access to the array elements)
lalitver10
1.1k
views
lalitver10
asked
Jan 13, 2022
Programming in C
binary-heap
data-structures
heap-sort
time-complexity
+
–
1
votes
2
answers
4
UGC NET CSE | December 2004 | Part 2 | Question: 25
How much extra space is used by heapsort ? $O (1)$ $O (\log n)$ $O (n)$ $O (n^2)$
How much extra space is used by heapsort ?$O (1)$$O (\log n)$$O (n)$$O (n^2)$
go_editor
718
views
go_editor
asked
Mar 26, 2020
Algorithms
algorithms
heap-sort
ugcnetcse-dec2004-paper2
+
–
0
votes
0
answers
5
Cormen Edition 3 Exercise 6.4 Question 5 (Page No. 161)
Show that when all elements are distinct, the best-case running time of HEAPSORT is $\Omega(n\lg\ n)$.
Show that when all elements are distinct, the best-case running time of HEAPSORT is $\Omega(n\lg\ n)$.
akash.dinkar12
328
views
akash.dinkar12
asked
Jun 27, 2019
Algorithms
cormen
algorithms
binary-heap
heap-sort
descriptive
difficult
+
–
0
votes
0
answers
6
Cormen Edition 3 Exercise 6.4 Question 4 (Page No. 160)
Show that the worst-case running time of HEAPSORT is $\Omega(n\lg\ n)$.
Show that the worst-case running time of HEAPSORT is $\Omega(n\lg\ n)$.
akash.dinkar12
323
views
akash.dinkar12
asked
Jun 27, 2019
Algorithms
cormen
algorithms
binary-heap
heap-sort
descriptive
+
–
0
votes
0
answers
7
Cormen Edition 3 Exercise 6.4 Question 3 (Page No. 160)
What is the running time of HEAPSORT on an array $A$ of length $n$ that is already sorted in increasing order? What about decreasing order?
What is the running time of HEAPSORT on an array $A$ of length $n$ that is already sorted in increasing order? What about decreasing order?
akash.dinkar12
267
views
akash.dinkar12
asked
Jun 27, 2019
Algorithms
cormen
algorithms
binary-heap
heap-sort
descriptive
+
–
0
votes
0
answers
8
Cormen Edition 3 Exercise 6.4 Question 2 (Page No. 160)
Argue the correctness of HEAPSORT using the following loop invariant: At the start of each iteration of the for loop of lines $2–5$,the subarray $A[1..i]$ is a max-heap containing the $i$ smallest elements of $A[1..n] $, and the subarray $A[i+1..n]$ contains the $n- i$ largest elements of $A[1..n]$, sorted.
Argue the correctness of HEAPSORT using the following loop invariant:At the start of each iteration of the for loop of lines $2–5$,the subarray $A[1..i]$ is a max-heap ...
akash.dinkar12
389
views
akash.dinkar12
asked
Jun 27, 2019
Algorithms
cormen
algorithms
binary-heap
heap-sort
descriptive
+
–
0
votes
0
answers
9
Cormen Edition 3 Exercise 6.4 Question 1 (Page No. 160)
HEAPSORT(A) 1 BUILD-MAX-HEAP(A) 2 for i = A.length down to 2 3 exchange A[1] with A[i] 4 A.heapsize=A.heapsize – 1 5 MAX-HEAPIFY(A,1) illustrate the operation of HEAPSORT on the array $A=\langle 5,13,2,25,7,17,20,8,4 \rangle$
HEAPSORT(A) 1 BUILD-MAX-HEAP(A) 2 for i = A.length down to 2 3 exchange A with A[i] 4 A.heapsize=A.heapsize – 1 5 MAX-HEAPIFY(A,1)illustrate the operation of HEAPSORT ...
akash.dinkar12
341
views
akash.dinkar12
asked
Jun 27, 2019
Algorithms
cormen
algorithms
binary-heap
heap-sort
descriptive
+
–
1
votes
0
answers
10
Ace Test Series: Algorithm - Heap Sort
Q : What is the running time of heap sort for presorted input of size n? O(n) B) O(n^2) C) O(nlogn) D) O(logn) In the question they didn't mention if its a max or min heap and also they didn't mention if the presorted ... the time complexity would be O(n) and for decresing order it would be O(nlogn). Is the question incomplete or am i missing some concepts?
Q : What is the running time of heap sort for presorted input of size n?O(n) B) O(n^2) C) O(nlogn) D) O(logn)In the question t...
OneZero
1.1k
views
OneZero
asked
Dec 24, 2018
Algorithms
ace-test-series
heap-sort
algorithms
+
–
1
votes
1
answer
11
# Heap sort
Sort The Following Sequence of input using Heap sort. { 10 , 2 , 1 , 5, 3 ,8 ,11,24 ,7 } Please show the output at every pass because i am getting confused.
Sort The Following Sequence of input using Heap sort.{ 10 , 2 , 1 , 5, 3 ,8 ,11,24 ,7 }Please show the output at every pass because i am getting confused.
LavTheRawkstar
1.1k
views
LavTheRawkstar
asked
Sep 9, 2018
Algorithms
algorithms
binary-heap
heap-sort
sorting
+
–
0
votes
1
answer
12
Sorting:
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate? 1)QuickSort 2)MergeSort 3)HeapSort 4)Selection Sort Explain? How
You have to sort 1 GB of data with only 100 MB of available main memory. Which sorting technique will be most appropriate?1)QuickSort2)MergeSort3)HeapSort4)Selection Sort...
pradeepchaudhary
3.3k
views
pradeepchaudhary
asked
Jul 8, 2018
Algorithms
sorting
algorithms
time-complexity
heap-sort
+
–
0
votes
1
answer
13
Heap Sort
Would it be possible to implement a variant of heapsort based on a perfectly balanced ternary structure in which the children of node $i$ are at positions $3i - 1, 3i$, and $3i + 1$, and if so what would be the advantages and disadvantages of the new method?
Would it be possible to implement a variant of heapsort based on a perfectly balanced ternary structure in which the children of node $i$ are at positions $3i - 1, 3i$, a...
Balaji Jegan
573
views
Balaji Jegan
asked
Jun 18, 2018
Algorithms
algorithms
data-structures
heap-sort
+
–
1
votes
3
answers
14
Heapsort Comparisons
How many element comparisons would heap sort use to sort the integers $1$ to $8$ if they were initially in sorted order, initially in reverse sorted order?
How many element comparisons would heap sort use to sort the integers $1$ to $8$ if they wereinitially in sorted order, initially in reverse sorted order?
Balaji Jegan
3.4k
views
Balaji Jegan
asked
Jun 17, 2018
DS
data-structures
heap-sort
+
–
0
votes
0
answers
15
Sorting
You are asked to sort 15 randomly generated numbers. One should prefer - 1. Bubble Sort 2. Quick Sort 3. Merge Sort 4. Heap Sort Please explain why others 3 sorting algorithms except the answer can't be used ?
You are asked to sort 15 randomly generated numbers. One should prefer - 1. Bubble Sort2. Quick Sort3. Merge Sort4. Heap Sort Please explain why others 3 sorting algorith...
Rahul Ranjan 1
673
views
Rahul Ranjan 1
asked
Jun 15, 2018
Algorithms
sorting
algorithms
time-complexity
heap-sort
merge-sort
+
–
0
votes
1
answer
16
Space Complexity of Build Max Heap
Since Heapify is a recursive function, its space complexity is $O(logn)$ because of the stack space required for recursion. I also read that space complexity of heapsort is $O(1)$ beause of the explanation here - https://gateoverflow.in/79909/ ... complexity of build heap is $O(logn)$ then heapsorts complexity should also be the same . What am I missing here ?
Since Heapify is a recursive function, its space complexity is $O(logn)$ because of the stack space required for recursion.I also read that space complexity of heapsort i...
Hardik Maheshwari
4.8k
views
Hardik Maheshwari
asked
Jun 14, 2018
Algorithms
space-complexity
algorithms
binary-heap
heap-sort
+
–
0
votes
0
answers
17
Cormen 3rd edition Q.6.5-9
Give an O(n lgk)-time algorithm to merge k sorted lists into one sorted list, where n is the total number of elements in the input lists. Use a min heap for k-way merging.
Give an O(n lgk)-time algorithm to merge k sorted lists into one sorted list, where n is the total number of elements in the input lists. Use a min heap for k-way merging...
Aarvi Chawla
626
views
Aarvi Chawla
asked
Jun 14, 2018
Algorithms
heap-sort
+
–
2
votes
1
answer
18
Sorting
pankaj_vir
1.5k
views
pankaj_vir
asked
Mar 19, 2018
Algorithms
test-series
sorting
algorithms
heap-sort
radix-sort
+
–
1
votes
3
answers
19
[Algorithms] Heap sort
Merging k sorted lists of size n/k into one sorted list of n-elements using heap sort will take how much time ? My doubt First approach:- here it is mentioned heap sort so, heap sort will always take nlogn.and here also we have n elements and it will ... give o(k)+(logk)*(n/k) I think answer should be nlogn only because the second approach is not heap sort. Please check.
Merging k sorted lists of size n/k into one sorted list of n-elements using heap sort will take how much time ?My doubtFirst approach:- here it is mentioned heap sort so,...
rahul sharma 5
1.1k
views
rahul sharma 5
asked
Nov 27, 2017
Algorithms
algorithms
heap-sort
time-complexity
+
–
0
votes
0
answers
20
I know heapsort but have doubt on finding the comparisons , need help.
hem chandra joshi
494
views
hem chandra joshi
asked
Nov 25, 2017
Algorithms
heap-sort
+
–
0
votes
1
answer
21
complexity analysis
Space complexity = input size + extra space So, heap sort also takes input of an 'n' size array. Does this mean that space cost of heap sort algo is O (n).
Space complexity = input size + extra spaceSo, heap sort also takes input of an 'n' size array.Does this mean that space cost of heap sort algo is O (n).
Suryakant
727
views
Suryakant
asked
Jun 30, 2017
Algorithms
space-complexity
sorting
heap-sort
+
–
1
votes
3
answers
22
Self doubt
You are asked to sort 15 randomly generated numbers. One should prefer— (a) Bubble sort (b) Quick sort (c) Merge sort (d) Heap sort I think the answer should be c or d crct me???
You are asked to sort 15 randomly generated numbers. One should prefer—(a) Bubble sort (b) Quick sort (c) Merge sort (d) Heap sortI think the answer should be c or d cr...
Shubhanshu
1.6k
views
Shubhanshu
asked
Jun 6, 2017
Algorithms
algorithms
sorting
merge-sort
heap-sort
+
–
6
votes
1
answer
23
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.1k
views
shraddha_gami
asked
Apr 13, 2017
Algorithms
sorting
binary-heap
heap-sort
+
–
1
votes
1
answer
24
proof
1) Show that when all elements are distinct, the best case running time of HEAPSORT is Ω(n log n). 2) Show that the worst case running time of HEAPSORT is Ω(n log n).
1) Show that when all elements are distinct, the best case running time of HEAPSORT is Ω(n log n).2) Show that the worst case running time of HEAPSORT is Ω(n log n).
firki lama
2.6k
views
firki lama
asked
Apr 12, 2017
Algorithms
heap-sort
+
–
2
votes
1
answer
25
#HeapSort
What is the worst case time complexity of finding a element in max heap tree ? Explain.
What is the worst case time complexity of finding a element in max heap tree ?Explain.
S Harika
834
views
S Harika
asked
Apr 1, 2017
Algorithms
heap-sort
+
–
1
votes
2
answers
26
Algorithm
what is the time complexity of finding a number in a heap sort in worst case & what is the time complexity for deleting the element from heap?
what is the time complexity of finding a number in a heap sort in worst case & what is the time complexity for deleting the element from heap?
itsapoorv94
856
views
itsapoorv94
asked
Mar 31, 2017
Algorithms
time-complexity
heap-sort
+
–
2
votes
1
answer
27
WHICH SORTING TO SELECT?
As part of maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be— (a) Bubble sort (b) Insertion sort (c) Selection sort (d) Heap sort
As part of maintenance work, you are entrusted with the work of rearranging the library books in a shelf in proper order, at the end of each day. The ideal choice will be...
deepak mahapatra
16.9k
views
deepak mahapatra
asked
Jan 19, 2017
Algorithms
sorting
heap-sort
+
–
0
votes
2
answers
28
Sorting
reena_kandari
543
views
reena_kandari
asked
Jan 10, 2017
Algorithms
sorting
heap-sort
test-series
+
–
Page:
1
2
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register