On Tuesday, 13 August 2019 at 14:04:45 UTC, Sebastiaan Koppe wrote:
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.

Thank you, this is what I eventually chose to do. It's also fairly fast, though doesn't the nature of the dynamic array slow it down a bit? Since I already know the size of the array (but just not at compile time), can't I define an array of fixed size, which is dependent on the input of the function?

Reply via email to