-
In Machine Code, what is the quickest way to sort bytes?I am playing around with some ordering of sprites, where I want to order them by vertical position. I used some Rodnay Zaks code to order some bytes…
... en.wikipedia.org/wiki/Comb_sort"]Comb Sort[/URL] is actually faster ... than quick sort in either best or ... and 20 minutes for comb to sort 80,000 records. But ... out of order.
;COMB SORT
; PARAMETERS: NumberOfElements = number ... -
The Only Reason Sinclair Succeeded (Provoking Controversy)Although I love my Sinclairs dearly, I think that the only reason they succeeded was because at the time most people did not know any better (factori…
... clock cycles!):
Since a sort in a game is likely ... after the first time the sort has been run then for ... be. A more complex sort routine (quick sort, comb sort) would also be interesting ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
Try looking up the comb sort. It should rival quicksort. If I remember right, it actually beats quicksort on best or worst case... not sure which. Since it is kinda based on the bubble sort it should be easy to implement. -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... ;481446]Try looking up the comb sort. It should rival quicksort. ... />
Coded up a example COMB SORT and it is significantly slower ... that my SHELL SORT version (~12 seconds to ... br />
[CODE]110 REM COMB SORT V1
120 LET b ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... /> Coded up a example COMB SORT and it is significantly slower ... that my SHELL SORT version (~12 seconds to ...
[CODE]110 REM COMB SORT V1
120 LET b ... me.
The comb sort is supposed to repeat ... br /> [CODE]110 REM COMB SORT V1
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... this.
[CODE]110 REM COMB SORT V2
120 LET b ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... right to me.
The comb sort is supposed to repeat without ... end up with an incomplete sort.
If you can ... it
[CODE]110 REM COMB SORT V1
120 LET b ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... this.
[CODE]110 REM COMB SORT V2
...[/CODE][/QUOTE]< ...
Coded up your V2 Comb Sort and got the following results ...
Paddy's original V1 Comb Sort = ~20 seconds
Paddy's ... s V2 Comb Sort = ~29 seconds
Jame's V2 Comb Sort (using 1 ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
I just checked the comb sort samples on the web and the code is not supposed to repeat at each level. The only place it will repeat is when the gap is 1 so so Paddy's code had that right. -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... Average 13.44 seconds
Comb Sort v1 (Paddy) ... Average 20 ... .05 seconds
Comb Sort v2 (JamesD) ... Average 26 ... .42 seconds
Comb Sort v3 (JamesD) ... Average 13 ... .26 seconds
Comb Sort v4 (JamesD) ... Average 13 ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... would indicate that your v3 Comb Sort is marginally faster than the ... remember right, the Comb Sort, Quick Sort, and Shell Sort are pretty neck & ... thing I liked about the Comb Sort was it's pretty ... />
[CODE]
110 REM COMB SORT V5
120 LET p ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... /> Original v4 Comb Sort ... ~13.45 seconds
Multiplication v5 Comb Sort ... ~14.95 ... seconds
Constants v6 Comb Sort ... ~14.42 ... from the fact that the sort stops working!).
Paddy -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... ]
[CODE]
110 REM COMB SORT V6
120 LET o ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... SUB 240
110 REM COMB SORT V7
120 LET p ... :
PRINT AT 0,0;"COMB SORT v7";
AT 2,0 ... above code gives an average sort time of 15.7 seconds ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... party! Looks like the Quick Sort is er... quick although I ... rather than 64 in the Comb/Shell Sort examples. What do you ... overly keen on the Quick Sort as it uses recursion and ... though - I will revist the Comb Sort to see if they can ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... ;483573]Looks like the Quick Sort is er... quick although I ... rather than 64 in the Comb/Shell Sort examples. What do you ... overly keen on the Quick Sort as it uses recursion and ... though - I will revist the Comb Sort to see if they can ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
[QUOTE=Einar Saukas;483584]Good luck![/QUOTE]
Checked the Shell and Comb sort programs for your tips and we are already doing all of those. Worth checking though.
Thanks
Paddy -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... of to speed up the comb sort would be to use another ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... the INT() slowed down the sort... so does inserting INT() at ... the start speed up the sort a tiny bit? Maybe for ... ?
[CODE]
110 REM COMB SORT V4.1
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... . here.
[CODE]110 REM COMB SORT V7.4?
120 LET ... this:
[CODE]110 REM COMB SORT V7.4?
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... the INT() slowed down the sort... so does inserting INT() at ... the start speed up the sort a tiny bit? Maybe for ... ?
[CODE]
110 REM COMB SORT V4.1
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... :
[CODE]
110 REM COMB SORT V7.2?
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... />
[CODE]
110 REM COMB SORT V7.3?
120 LET ... to run it for every sort.
Combined 150 and 160 ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... !):
[CODE]110 REM COMB SORT V4.3
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... ;484023]
[CODE]110 REM COMB SORT V4.3
120 LET ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... of code for the actual sort, 120 could be combined with ... separate.
[CODE]110 REM COMB SORT V7.?
120 LET p ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... 48K Spectrum to run either comb sort or quicksort ([B]step 4 ... programs should be able to sort about 8,000 numbers in ... -
Sorting an array...Hi Folks, Over the weekend I had a play with sorting algorithms - takes me back to my student days! :-o My first try was with the good old Bubble S…
... SUB 230
110 REM COMB SORT V4.4
120 LET ... :
PRINT AT 0,0;"COMB SORT v4.4";AT 2,0 ...