Bucketsort: Difference between revisions

m
no edit summary
mNo edit summary
 
(2 intermediate revisions by the same user not shown)
Line 1:
=={{header|QB64}}==
<lang B64>
'* Complexity Class: O(N^2)
TYPE MINMaxRec
min AS LONG
Line 11 ⟶ 12:
NEXT
DoRecurse% = -1
DemoOrder& = 1 '* -1 = descending, 1 = desecending
BucketSort a(), LBOUND(a), UBOUND(a), DemoOrder&, DoRecurse% '* without the recursive initial call, executiom time is FAR slower.
 
Line 53 ⟶ 54:
BucketSort Array(), BS_Local_Last_Insert_Index, BS_Local_Current_Insert_Index - 1, order&, 0
ELSE
'* using MergeSort will speed this significantly, however, this will be left as an exercise
'* MergeSort will keep this sorting algorithm quite competitive.
InsertionSort Array(), BS_Local_Last_Insert_Index, BS_Local_Current_Insert_Index - 1, order&
END IF
Anonymous user