insertion sort on a singly linked list -


Am I correct in thinking that it is not possible to sort the inclusion on a single listed list?

My argument: Assuming that the entry type means by definition, as we go to the right place in the outer loop, we go to the left in the internal loop and As a result, an SLL can not include such algorithm as we change the values ​​(to correct) and put our current value when done with internal loop. correct?

Well, I had a sound like a Captain, but the answer depends on whether you 'All iterations are preserved as well as guided in the same way as the elements are connected and still implement the proper sorting algorithm according to your definition. I really do not want to mess around around your definition of sorting the entry, so I'm scared that you really have to think yourself. At least for a while. This is homework anyway ...;)

OK, this is the page that I found before the page is closed. You can iterate on an SLL in the opposite direction, but it will take the n * n / 2 traversal to visit all the N elements. So you are theoretically okay with your traverse instructions for your sorting loop. It seems that the solution to your question is very high.

Comments