This week's book giveaway is in the OCMJEA forum.
We're giving away four copies of OCM Java EE 6 Enterprise Architect Exam Guide and have Paul Allen & Joseph Bambara on-line!
See this thread for details.
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


Win a copy of OCM Java EE 6 Enterprise Architect Exam Guide this week in the OCMJEA forum!
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."
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: When which is better - Heap Sort or Quick Sort