(lst: list[Any])
| 17 | |
| 18 | |
| 19 | def insertion_sort(lst: list[Any]) -> list[Any]: |
| 20 | length = len(lst) |
| 21 | |
| 22 | for index in range(1, length): |
| 23 | value = lst[index] |
| 24 | pos = binary_search(lst, value, 0, index - 1) |
| 25 | lst = [*lst[:pos], value, *lst[pos:index], *lst[index + 1 :]] |
| 26 | |
| 27 | return lst |
| 28 | |
| 29 | |
| 30 | def merge(left: list[Any], right: list[Any]) -> list[Any]: |
no test coverage detected