Mergesort for singly-linked lists gives correct results but leaks memory
I’m working on an assignment to implement mergesort for singly-linked lists in C++. The merge
function needs to merge two sorted lists in-place without creating new nodes. The mergesort
function should create a new sorted list without modifying the input list.
Mergesort for singly-linked lists gives correct results but leaks memory
I’m working on an assignment to implement mergesort for singly-linked lists in C++. The merge
function needs to merge two sorted lists in-place without creating new nodes. The mergesort
function should create a new sorted list without modifying the input list.