I am wondering how do you sort a list along the x axis before the y axis for a list ? I know it can be done using LINQ but it adds to the garbage collection and i would like to avoid that and use a raw C# code version that i can refer back to know how its done. I tried thinking about how to do it but couldn’t work out how to loop multiple times through the list if that made any sense?
I haven’t taken computer science but i presume quick sort is the fastest option since it has the word quick in the name ? What i was wondering though, how do you recursively run through partitions? I understand the logic of how to split the list from low to high but don’t know how to do it recursively in C#.
oh ok,
first, quick sort is great but it’s not the best all the time.
since you are new to coding I would make something straight forward.
first your array of vector2 (Vector2[ ]) and a second array of the same lenght.
Then I would run a loop that will loop all the array and search for the “smallest” one, once you find it run it again but now for the second number, it’s slow, not the best but it’s easy to implement