News for hackers. Stuff that matters.
Re:Twitter Sort by anon4 on Wednesday January 14, 2015 @09:01AM (#8886230)
This can be improved. The following should be sufficient:

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)

There are no comments on this comment yet.