This post originally appeared on Arjun Rajkumar 's blog. Arjun is a web developer based in Bangalore, India.
--
Day 3: Question 2
I op...
For further actions, you may consider blocking this person and/or reporting abuse
This was very similar to binary search as it was mostly sorted. Just had to keep splitting until the mid word was lesser than starting word.
Binary search so its O[logn] time and space if O[1]
Nice. There is a similar real world problem when writing journalling file systems: they need to find the rotation point of the journal, even after a system failure that didn't permit saving that information anywhere well known. The solution is similar too, a binary search through disk blocks looking for the point where the journal index goes down instead of up :)