Use Linq. Not the fastest, but quick and easy…

using System.Linq;
List<NodePos> sortedNodes = nodes.OrderBy(o => o.distance).ToList();

 

 


Discover more from

Subscribe to get the latest posts sent to your email.

Leave a comment

Trending