Blog

Your dream job? Lets Git IT.
Interactive technical interview preparation platform designed for modern developers.

XGitHub

Platform

  • Categories

Resources

  • Blog
  • About the app
  • FAQ
  • Feedback

Legal

  • Privacy Policy
  • Terms of Service

© 2025 LetsGit.IT. All rights reserved.

LetsGit.IT/Categories/Algorithms
Algorithmsmedium

QuickSort vs MergeSort?

Tags
#sorting#quicksort#mergesort#comparison#complexity
Back to categoryPractice quiz

Answer

Both are divide‑and‑conquer sorts. QuickSort partitions around a pivot, is in‑place and very fast on average O(n log n), but has O(n²) worst‑case and is not stable. MergeSort splits and merges, is stable with guaranteed O(n log n) worst‑case, but needs O(n) extra memory and works well for linked lists/external sorting.

Related questions

Algorithms
Heap sort: what are its time complexity, space complexity, and stability?
#heapsort#sorting#complexity
Algorithms
Bitmask DP (subset DP): what is it and what is a typical complexity?
#dp#bitmask#subset
Algorithms
Sliding window: what is it and when is it better than nested loops?
#sliding-window#two-pointers#complexity
Algorithms
Counting sort: when can it be faster than O(n log n) sorting?
#counting-sort#sorting#stability
Algorithms
What does amortized O(1) mean? Explain with dynamic array growth.
#amortized#complexity#dynamic-array
Algorithms
Randomized pivot in QuickSort/Quickselect — why does it help?
#randomization#quicksort#quickselect