-
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=Paddy Coleman;483960]Hi JamesD,
< ... vs ~13.17).
Paddy[/QUOTE]
Interesting.
Forcing ... -
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=Paddy Coleman;483965]Hi JamesD,
< ... (first time through).
Paddy[/QUOTE]
That code would ... -
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=Dr BEEP;483980]FOR .. NEXT is really slow, try using IF .... GO TO[/QUOTE]
Hi Dr Beep,
I wondered about FOR/NEXT vs IF/GOTO so I ran some tests. The code was basically:
[CODE]100 FOR a=1 TO 1000:
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…
Hi Folks,
OK, did some profiling in BASin and found that the [FONT="Courier New"][B]LET d=a+b[/B][/FONT] line actually slows things down! The following generates an average run time of 12.07 seconds (over a second quicker!):
[ ... -
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=Paddy Coleman;484023]
[CODE]150 IF b>1
THEN
LET b=INT (b/p):
IF 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…
[QUOTE=Paddy Coleman;484027]Profiling indicated that ... ~11.59 seconds.
Paddy[/QUOTE]
So INT rounds ... -
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=Paddy Coleman;484023]Hi Folks,
... use a variable.
Paddy[/QUOTE]
Actually, I think ... -
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=Paddy Coleman;484027]Profiling indicated that ... ~11.59 seconds.
Paddy[/QUOTE]
I thought it ... -
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=Paddy Coleman;484094]Hi JamesD,
< ... , but it works?
Paddy[/QUOTE]
That just ... -
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=Paddy Coleman;484102][CODE]IF b1 AND c=1 THEN GO TO 130[/CODE]
[/QUOTE]
But if b=1 it does not loop. -
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=Paddy Coleman;484102]OK, final optimisation ... -
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=Paddy Coleman;484179]OK, had a ... /> Not bad eh? ;)
Paddy[/QUOTE]
Funny how many ... -
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=Paddy Coleman;484179]The above removes ... -
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=Paddy Coleman;484410]Hi Einar,
< ... />
Many thanks
Paddy[/QUOTE]
Thanks for ...