Sorting algorithms/Tree sort on a linked list: Difference between revisions

Content added Content deleted
Line 569: Line 569:
Some comments:
Some comments:


I see the task used to have something to do with Finnegan's wake, and with counting cycles, etc. Here I simply sort a list of integers.
I see the task used to have something to do with Finnegan's Wake, and with counting cycles, etc. Here I simply sort a list of integers.


It is unlikely, in ATS, that someone would use doubly-linked lists as their canonical linked list implementation. Therefore sorting a singly-linked list this way would be interesting, but I cannot think of a way to do it without allocating new nodes. Of course, a quicksort or mergesort can be done on a singly-linked list without allocating new nodes.
It is unlikely, in ATS, that someone would use doubly-linked lists as their canonical linked list implementation. Therefore sorting a singly-linked list this way would be interesting, but I cannot think of a way to do it without allocating new nodes. Of course, a quicksort or mergesort can be done on a singly-linked list without allocating new nodes.