Results 1 to 9 of 9
Thread: snailsort algorithm
- 05-09-2010, 09:26 PM #1
Member
- Join Date
- May 2010
- Posts
- 1
- Rep Power
- 0
- 05-09-2010, 10:31 PM #2
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
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.
Ever seen a dog chase its tail? Now that's an infinite loop.
- 05-10-2010, 12:20 AM #3
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 AM #4
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
Oh my. Maybe it should be called UselessWasteOfCPUTime sort instead :D.
Ever seen a dog chase its tail? Now that's an infinite loop.
- 05-10-2010, 01:04 PM #5
Snails 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 ...
We've heard of tail recursion. Perhaps we can call your dog example tail iteration. :DEver seen a dog chase its tail? Now that's an infinite loop.
- 05-10-2010, 01:27 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
Here's a nice page about terrible sorting algorithms. My favourite is 'monkey sort' ;-)
kind regards,
Jos
- 05-10-2010, 02:38 PM #7
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
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*
Ever seen a dog chase its tail? Now that's an infinite loop.
- 05-10-2010, 02:53 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,399
- Blog Entries
- 7
- Rep Power
- 17
- 05-11-2010, 10:54 PM #9
Senior Member
- Join Date
- Feb 2010
- Location
- Ljubljana, Slovenia
- Posts
- 470
- Rep Power
- 4
Similar Threads
-
Help with an Algorithm
By Manfizy in forum New To JavaReplies: 22Last Post: 07-03-2009, 07:16 AM -
O(log n) algorithm help !!!!!!
By itseeker87 in forum New To JavaReplies: 8Last Post: 09-09-2008, 05:12 PM -
Help with algorithm
By susan in forum New To JavaReplies: 1Last Post: 07-13-2007, 10:26 PM -
Help me with this algorithm
By Marcus in forum Advanced JavaReplies: 3Last Post: 07-02-2007, 01:30 PM -
Help with Algorithm
By Daniel in forum Advanced JavaReplies: 2Last Post: 07-02-2007, 05:51 AM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks