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

Someone posted an "algorithm" for sorting integers in bash by calling a function f, which sleeps for n seconds and then prints n. Smaller numbers will cause f to wake up and print earlier than larger numbers, so the result is that you have a sorted list print back.

Unless you have small numbers, or negative numbers, or very closely grouped numbers, or...

It was a joke, I think. (I hope)



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

Search: