News for hackers. Stuff that matters.
Re:Twitter Sort by coreyja on Tuesday January 13, 2015 @08:52PM (#8883814)
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.
Re:Twitter Sort by pliny on Wednesday January 14, 2015 @03:08AM (#8884924)
The speed is definitely not independent of the size since you still have to write a string of size O(n).