Hi

Im pretty new to anything maths and algorithm with java....... so my question is has anyone heard of sort method known as snail sort? I cannt seem to find any information on it or the type of big O notation it follows.......

Thanks

Printable View

- 05-09-2010, 09:26 PMab6301snailsort algorithm
Hi

Im pretty new to anything maths and algorithm with java....... so my question is has anyone heard of sort method known as snail sort? I cannt seem to find any information on it or the type of big O notation it follows.......

Thanks - 05-09-2010, 10:31 PMm00nchile
I wouldn't know a sorting algorithm called snailsort, but I'm assuming this is part of a class, and this particular algorithm was used to showcase the less efficient (ie. O(square(n)) algorithm family. Most probably it's bubble sort, or straight insertion.

- 05-10-2010, 12:20 AMJavaGAR
I found this code for snailsort, and it appears to be an O(n^4) sorting algorithm. Accordingly, snailsort seems an appropriate name for it.:D

- 05-10-2010, 07:09 AMm00nchile
Oh my. Maybe it should be called UselessWasteOfCPUTime sort instead :D.

- 05-10-2010, 01:04 PMJavaGARSnails and Dogs
Whoever came up with the snailsort algorithm probably had a sense of humor, so it probably was not intended for commercial use. ;)

Speaking of senses of humor, m00nchile, I like what you wrote ...

Quote:

Ever seen a dog chase its tail? Now that's an infinite loop.

*tail recursion*. Perhaps we can call your dog example*tail iteration*. :D - 05-10-2010, 01:27 PMJosAH
Here's a nice page about terrible sorting algorithms. My favourite is 'monkey sort' ;-)

kind regards,

Jos - 05-10-2010, 02:38 PMm00nchile
There is something about code this bad, that it's practically genious. Randomly swapping pairs of elements and hoping the array gets sorted? *head explodes*

- 05-10-2010, 02:53 PMJosAH
- 05-11-2010, 10:54 PMm00nchile
Yeah, that actually is just a short leap away from genetic programming. I'm looking into it just now, since it fits a project I have to do at uni like a glove.