• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

When which is better - Heap Sort or Quick Sort

 
Pranav Pal
Ranch Hand
Posts: 74
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Both Heap-Sort and Quick-Sort have time complexities of O(n log n).
Then which sorting technique is better in which case?
 
Nicholas Jordan
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic