Live data from Hacker News

Twitter Sort

github.com

31–40 of 55 posts

Re: Twitter Sort

#31

https://duckduckgo.com/?q=!twitter+Those+numbers+aren%27t+so... Still no uses of this in the wild.

Lol at this reply from someone. Always sanitize your inputs, kids.

@harrisonpage 4,8,15,16,23,42,\"import os, subprocess; subprocess.call(["rm","-rf","~"])

Re: Twitter Sort

#33
post #11
post #6

Earlier quoted context omitted.

[deleted]

Big-O notation refers to the worst case runtime of an algorithm. I have no idea where this misconception comes from. Big-O notation is a type of bound on a function's growth rate. That function can represent anything. Best case performance, worst case performance, average case performance, memory usage, how many times you are likely to phone someone while you wait, etc. The standard example showing this is that hash…

that's not 100% true as well, you got omega and theta and others as well for the other cases.

Edit: See http://stackoverflow.com/questions/471199/what-is-the-differ...

Re: Twitter Sort

#35
I was wondering about correctness, but I found in the code comments: "when there is a reply, we check to ensure they're sorted". What a relief.

Re: Twitter Sort

#36
post #10
post #5

I wonder what's the efficiency of this algorithm in O notation on average.

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 speed is definitely not independent of the size since you still have to write a string of size O(n).

Re: Twitter Sort

#38
post #4

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 w…

Regarding maximum input size, I'm sure it can be forked to implement a tweet-sharding approach.

In the sorting world it's called a bucket, not a shard.

Re: Twitter Sort

#40

Now when do we get a Twitter bot that listens for Twitter Sort tweets and replies with a result from stacksort?

The twitter bot could search for twitter sort tweets and solve them using twitter sort!
Post reply on HN