ejes consulting

Techincal Consulting Design and Automation

New Sort? (kind of)

leave a comment »

One doesn’t find a new sorting algorithm floating around the internet very often, but here’s one that I found that’s actually kind of neat.

It’s not really very practical, but it’s still very fun. It’s quite simple. For each element of the array, you fork a new process which sleeps it’s value in seconds then displays that number. Repeat for the entire array.

function f() {
    sleep "$1"
    echo "$1"
while [ -n "$1" ]
    f "$1" &

found here!


Written by ejes

September 26, 2011 at 1:14 pm

Posted in Uncategorized

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: