Skip to content

Instantly share code, notes, and snippets.

View alexholehouse's full-sized avatar

Alex Holehouse alexholehouse

View GitHub Profile
@alexholehouse
alexholehouse / juliaqs
Created May 6, 2012 19:41
Julia Quicksort
function qsort!(a,lo,hi)
i, j = lo, hi
while i < hi
pivot = a[(lo+hi)>>>1]
while i <= j
while a[i] < pivot; i = i+1; end
while a[j] > pivot; j = j-1; end
if i <= j
a[i], a[j] = a[j], a[i]
i, j = i+1, j-1