Bucket sort

This is an old revision of this page, as edited by 202.54.13.34 (talk) at 12:42, 16 December 2002. The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


BUCKET-SORT(A)
1 n <- length[A]
2 for i <- 1 to n
3 do insert A[i] into list B[floor(nA[i])]
4 for i <- 0 to n -1
5 do INSERTION-SORT(”[i])
6 concatenate the lists B[0]...B[n-1] in order