Commit 2dfa10d
committed
Add time and space complexity analysis to insertion_sort docstring
Document the performance characteristics of insertion sort in the
function docstring:
- Time Complexity: O(n^2) worst/average case, O(n) best case
(already sorted input)
- Space Complexity: O(1), sorts in place
Fixes #148661 parent f5988cc commit 2dfa10d
1 file changed
Lines changed: 6 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
34 | 40 | | |
35 | 41 | | |
36 | 42 | | |
| |||
0 commit comments