The sorting code is buggy - it does partially sort the list, but not fully.

I suggest you pick a trivial set of values and step through each method by hand keeping track of what happens on paper.