Skip to content
Snippets Groups Projects
Commit acd8c43a authored by Louis Chmielewski's avatar Louis Chmielewski
Browse files

merge_sort list_to_native

parent e690817d
Branches
No related tags found
No related merge requests found
...@@ -105,7 +105,11 @@ def list_to_native(li: ApLst) -> list[T]: ...@@ -105,7 +105,11 @@ def list_to_native(li: ApLst) -> list[T]:
$$$ list_to_native(ApLst(3, ApLst(1, ApLst(4, ApLst(1, ApLst(5, ApLst())))))) $$$ list_to_native(ApLst(3, ApLst(1, ApLst(4, ApLst(1, ApLst(5, ApLst()))))))
[3, 1, 4, 1, 5] [3, 1, 4, 1, 5]
""" """
... res = []
while not li.is_empty():
res.append(li.head())
li = li.tail()
return res
def is_sorted(l: ApLst, comp: Callable[[T, T], int]=compare) -> bool: def is_sorted(l: ApLst, comp: Callable[[T, T], int]=compare) -> bool:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment