A sorted array . for eg: 2,3,6,8,11,23,56,89
It is right shifted unknown times eg: 23,56,89,2,3,6,8,11
now search an element in the array... say eg:56.
(no linear search allowed.)
answer in my mind:
1. first find the largest element by log(n) 2. now remove the first part or last part depends on search element.3. now log(n) search for the item.
posted by yetanother.softwarejunk #
9:41 AM