How should I sort a doubly linked list the D way?

Sebastiaan Koppe mail at skoppe.eu
Tue Aug 13 14:04:45 UTC 2019


On Tuesday, 13 August 2019 at 09:48:52 UTC, Mirjam Akkersdijk 
wrote:
> and I would like to sort based on Node.t, how should I tackle 
> it, preferably without resorting to C libraries?

Convert the nodes into an D array, sort the array with 
nodes.sort!"a.x < b.x" and then iterate the array and repair the 
next/prev pointers.


More information about the Digitalmars-d-learn mailing list