1
Name:
Anonymous
2009-09-07 21:49
In this thread we will discuss sorting algorithms and vote for our favorite one.
I will update the stats every postIndex % 25 posts.
May the best #sort win!
- Bubble Sort
- Insertion Sort
- Selection Sort
- Merge Sort
- Quick Sort
- Heap Sort
- Shell Sort
- Bucket Sort
- Radix Sort
Vote for one of these or any sort you like. I'll add new sorts to the list when I update stats.
81
Name:
Anonymous
2009-09-08 16:53
from random import shuffle
def bogo_sort(seq):
count = 0
while not all(x <= y for x, y in zip(seq, seq[1:])):
shuffle(seq)
count+=1
print seq,'in',count
>>> bogo_sort([1,6,9,3,2,87])
[1, 2, 3, 6, 9, 87] in 900
>>> bogo_sort([1,6,9,3,2,87])
[1, 2, 3, 6, 9, 87] in 172
[b]>>> bogo_sort([1,6,9,3,2,87])
[1, 2, 3, 6, 9, 87] in 2[/b]
>>> bogo_sort([1,6,9,3,2,87])
[1, 2, 3, 6, 9, 87] in 868
IT'S LIKE THE BEST SORTING ALGORITHM EVAR
82
Name:
Anonymous
2009-09-08 17:01
>>81
Who cares about run counts? Complexity analysis or GTFO.
84
Name:
Anonymous
2009-09-08 19:53
Bucket sort. Because I feel bad for it.
88
Name:
Anonymous
2009-09-08 23:42
Bogosort. Look at all the retarded humor attempts that all received only one vote. OP should have limited the whole "adding sorts" thing.
90
Name:
Anonymous
2009-09-08 23:49
Quicksort. Works best in C/C++, my favorite languages.
91
Name:
Anonymous
2009-09-09 0:16
Insertion sort. The only one I can ever remember.
93
Name:
Anonymous
2009-09-09 0:20
Whats with people only knowing insertion sort? kinda random.
95
Name:
Anonymous
2009-09-09 0:57
Is there a difference between a search and a sort? I mean.. searches sort also right?
97
Name:
Anonymous
2009-09-09 1:06
>>95
a search is all about locating an element within an array. they do not necessarily have to sort the array (a simple linear search searches from one end of the array to the other, for instance.)
a sort re-orders elements in an array according to some comparison function.
98
Name:
Anonymous
2009-09-09 1:17
>>97
YHBT. But you are a nice guy so I wont hold it against you.
106
Name:
Anonymous
2009-09-09 5:27
>>88
Bogosort. Look at all the retarded humor attempts that all received only one vote. OP should have limited the whole "adding sorts" thing.
OP has an agenda, and non-faggotry would fail to promote it.
107
Name:
Anonymous
2009-09-09 8:39
I'm torn between Bogosort and Fibonacci Butt Sort.
110
Name:
Anonymous
2009-09-09 8:53
What the fuck, FBS doesn't sort anything.
116
Name:
Anonymous
2009-09-09 12:25
>>112
that one that someone posted on 4-ch? about fucking kids and stuff?
117
Name:
Anonymous
2009-09-09 13:41
>>114
It's kind of difficult to sort out the ashes.
120
Name:
Anonymous
2009-09-09 15:52
God sort. O(0) time complexity for the win.