Problem to sort numbers

Discuss GUI programming with the RapaGUI plugin here
plouf
Posts: 473
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: Problem to sort numbers

Post by plouf »

i understand that it need a different function and logc for everything but how it decides ?

does it run internally, a compare between EACH two column items ?
Christos
User avatar
jPV
Posts: 604
Joined: Sat Mar 26, 2016 10:44 am
Location: RNO
Contact:

Re: Problem to sort numbers

Post by jPV »

I guess it uses some generic sorting algorithm (quicksort or so), which doesn't need to compare each item with all other items, but is narrowing it down with less tries.

You can see what it's doing by adding "DebugPrint(e1, e2)" in the sorting function. With a quick look it seems to do something like average 4-5 comparisons per item with that example code with 15 items. It's still calling the function quite many times, so better not make it too heavy either...
Post Reply