Arc Forumnew | comments | leaders | submitlogin
1 point by akkartik 4461 days ago | link | parent

Why do you say they aren't stable? I need to add a comparer to test stability:

  (def qsort(l <)
    (iflet (p . xs) l
      (+ (qsort (keep [< _ p] xs) <)
         list.p
         (qsort (rem [< _ p] xs) <))))
..but that aside I think the sort will be stable, because later equal elements always end up in the last qsort, and rem is stable.


2 points by rocketnia 4461 days ago | link

That makes sense. I spoke too soon. :)

-----