Fix comments

This commit is contained in:
Hardik Pawar 2024-10-03 11:28:01 +05:30
parent 121bfdae5f
commit 809e74b7f2

View File

@ -156,9 +156,9 @@ def merge_sort_linked_list(head: Node | None) -> Node | None:
next_to_middle = middle.next
middle.next = None # Split the list into two parts
left = merge_sort_linked_list(head) # Sort the left half
right = merge_sort_linked_list(next_to_middle) # Sort the right half
sorted_list = merge(left, right) # Merge the sorted halves
left = merge_sort_linked_list(head) # Sort left half
right = merge_sort_linked_list(next_to_middle) # Sort right half
sorted_list = merge(left, right) # Merge sorted halves
return sorted_list