03-04-2023, 06:52 PM
(03-04-2023, 06:47 PM)SMcNeill Wrote: Part of the bottleneck for my routine comes from converting to string to store the index and then reading it back. (But, it's a working example of using an array inside an array, which everyone has been talking about for the past month in the other post...) If we didn't have to worry about tracking the other 2 elements in your custom type, all we'd have to do is count the values instead of storing them and there wouldn't be any type of string conversion involved in the process. As it is, QB64's string overhead is slowing us down to the point where Qsort is faster this time around.
It's still a fascinating sorting routine and one that is easy to understand and use where speed isn't so crucial. My understanding of sorting never evolved beyond the good old bubble sort so seeing these other methods of sorting like yours is a real eye opener.