While potentially more efficient than bogosort for larger input size, this sorting algorithm has a serious limitation. I am of course talking about being limited to 140 characters per tweet. This seriously restricts maximum input size you can sort, which in turn severely cuts down on potential applications of this technology. Moreover, without deployed SAAS (sorting as a service) bot, algorithm is not deterministic which will complicate handling logic as you need to account for being forever alone without anyone to sort your numbers.
In short, I would advise against deploying this on production until technology is more mature.
Put your numbers in a pastebin, then post a link to the pastebin. Then, when you get the sorted numbers, post the sorted sequence in the original pastebin, thus creating a cloud-backed repository of sorted variants of number sequences. After that, you can check if your sequence is already on pastebin before asking twitter!
As tansey said Big-O for the worst case would be O(inf), Best case is O(1), if n is the length of the list, because if the sort returns the speed is independent of the size of the list. The average case is a little harder, but based on the 140 character limit someone else mentioned, I would say that the average case would be O(inf) cause on average it probably wouldn't correctly sort the list.
The probability of the original input list being in the exact order it's in is 1/(n!). If that's the order you wanted then the algorithm might very well approach O(0).
Instead of sorting to verify[1] the tweet has indeed been correctly sorted it might be better to just check the first and last entry. As the dataset might be very large (the current 140 character imposted by Twitter limit is merely an implementation detail).
Hardcoding the validation of the reply is an unfortunate obstacle to scaling this - the server would very quickly become CPU bound. They should really have made a TwitterSortValidationService which sends the answer out to the Twitter API, and then listens for a response confirming whether or not the original sort was correct.
[+] [-] TrainedMonkey|11 years ago|reply
In short, I would advise against deploying this on production until technology is more mature.
[+] [-] Mahn|11 years ago|reply
[+] [-] afandian|11 years ago|reply
1 - gzip content to store in a tweet. You could squeeze more out.
2 - store the content in an image and standardize on an OCR library
3 - use twitlonger.com for larger messages
EDIT: Anyway I thought app.net was meant to solve all this?
[+] [-] anon4|11 years ago|reply
[+] [-] ant6n|11 years ago|reply
[+] [-] danvayn|11 years ago|reply
[+] [-] kra34|11 years ago|reply
[+] [-] kovacs|11 years ago|reply
[+] [-] roehst|11 years ago|reply
[+] [-] anon4|11 years ago|reply
[+] [-] gkoberger|11 years ago|reply
http://gkoberger.github.io/stacksort
[+] [-] unknown|11 years ago|reply
[deleted]
[+] [-] siliconc0w|11 years ago|reply
[+] [-] misiti3780|11 years ago|reply
[+] [-] jpatokal|11 years ago|reply
http://pageoftext.com/wikiclock
[+] [-] stonewhite|11 years ago|reply
https://dis.4chan.org/read/prog/1295544154
[+] [-] abalone|11 years ago|reply
[+] [-] Mahn|11 years ago|reply
[+] [-] coreyja|11 years ago|reply
[+] [-] moe|11 years ago|reply
[+] [-] unknown|11 years ago|reply
[deleted]
[+] [-] archagon|11 years ago|reply
[+] [-] Dobbs|11 years ago|reply
[+] [-] msane|11 years ago|reply
[+] [-] blt|11 years ago|reply
[+] [-] anon4|11 years ago|reply
1. check that the list is the same size
2. for every element in the original, do a binary search in the new list; fail if not found
3. check that the element following the element you found is greater than it
This should make it run in the time it takes to do a binary search times the list size, or O(n * log n)
[+] [-] askmike|11 years ago|reply
[1] https://github.com/ExPHAT/twitter-sort/blob/master/main.py#L...
[+] [-] ponytech|11 years ago|reply
[+] [-] flavor8|11 years ago|reply
[+] [-] dandroid1|11 years ago|reply
[+] [-] JetSpiegel|11 years ago|reply
Still no uses of this in the wild.
[+] [-] viksit|11 years ago|reply
@harrisonpage 4,8,15,16,23,42,\"import os, subprocess; subprocess.call(["rm","-rf","~"])
[+] [-] rodw|11 years ago|reply
https://twitter.com/harrisonpage/status/555180585384046592
I think you want this query:
https://twitter.com/search?q=can+you+sort+these+numbers
[+] [-] mdoar|11 years ago|reply
[+] [-] cldellow|11 years ago|reply
[+] [-] kctess5|11 years ago|reply
[+] [-] stevewilhelm|11 years ago|reply
[+] [-] sippeangelo|11 years ago|reply
[+] [-] Tepix|11 years ago|reply
[+] [-] artenix|11 years ago|reply