Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nearly identical implementation in Erlang:

  qsort([]) -> [];

  qsort([Pivot|Rest]) ->
    qsort([ X || X <- Rest, X < Pivot]) 
    ++ [Pivot] ++ 
    qsort([ X || X <- Rest, X >= Pivot]).
More: http://en.literateprograms.org/Category:Quicksort


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: