diff --git a/Tp09/merge_sort.py b/Tp09/merge_sort.py index 23d33ac58c18408dd150538991aeb9e8f4b86ed5..0c016e04574e488243f6f949e12cd3c0091b40a2 100755 --- a/Tp09/merge_sort.py +++ b/Tp09/merge_sort.py @@ -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())))))) [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: