aspose file tools*
The moose likes General Computing and the fly likes When which is better - Heap Sort or Quick Sort Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » General Computing
Bookmark "When which is better - Heap Sort or Quick Sort" Watch "When which is better - Heap Sort or Quick Sort" New topic
Author

When which is better - Heap Sort or Quick Sort

Pranav Pal
Ranch Hand

Joined: Nov 04, 2007
Posts: 74
Both Heap-Sort and Quick-Sort have time complexities of O(n log n).
Then which sorting technique is better in which case?


Hakuna Matata!
Nicholas Jordan
Ranch Hand

Joined: Sep 17, 2006
Posts: 1282
Neither is 'better' - each has it's strengths. It would be better if you can provide a context for this question, in the simple case - neither is better: Each has it's correct place and use.


"The differential equations that describe dynamic interactions of power generators are similar to that of the gravitational interplay among celestial bodies, which is chaotic in nature."
 
wood burning stoves
 
subject: When which is better - Heap Sort or Quick Sort
 
Similar Threads
Big O
Heap Sort and Quick Sort
Sorting method
Quicksort vs Merge Sort
Quick Sort in Java