Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Combsort vs Quicksort

Name: Anonymous 2017-07-06 16:48

Combsort on short arrays is 20-30% faster than quicksort!
using combsort from:
https://www.reddit.com/r/frozenvoid/wiki/void2/sort_h

Name: Anonymous 2017-07-08 20:53


proc check(n: int): bool =
n != 0 and n mod 10 == n div 10 mod 10

proc dubssort(arr: var openarray[int]) =
var a = 0
for i in 0..arr.high:
if arr[i].check:
swap arr[i], arr[a]
a += 1

let lim = a - 1
for i in 0..lim:
for j in i..lim:
if arr[i] > arr[j]:
swap arr[i], arr[j]

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List