Skip to content

Commit 1e0d317

Browse files
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 <[email protected]>
1 parent c5de395 commit 1e0d317

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sorts/merge_sort.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def merge_sort(collection: list) -> list:
1818
:return: The same collection ordered in ascending order.
1919
2020
Time Complexity: O(n log n)
21+
Space Complexity: O(n)
2122
2223
Examples:
2324
>>> merge_sort([0, 5, 3, 2, 2])

0 commit comments

Comments
 (0)