Specify space complexity for merge sort (#11749)

* Added space complexity

Space complexity of merge sort is a key factor, when compared to quick sort

* Update merge_sort.py

---------

Co-authored-by: Maxim Smolskiy <mithridatus@mail.ru>
This commit is contained in:
Abhijit Kumar Singh
2025-08-30 06:07:13 +05:30
committed by GitHub
parent c5de3954cc
commit 1e0d3173fa

View File

@@ -18,6 +18,7 @@ def merge_sort(collection: list) -> list:
:return: The same collection ordered in ascending order.
Time Complexity: O(n log n)
Space Complexity: O(n)
Examples:
>>> merge_sort([0, 5, 3, 2, 2])