For an array, I'm using a left pointer (pointing to 0) and a right pointer (pointing to end).
For every iteration, if my search element is not found, I increment left and decrement right.
This iteration continues until
left <= right. Find the code snippet below
left = 0 right = length - 1 while left <= right: // search logic left += 1 right -= 1
What will be worst the time complexity of this algorithm?
Also, is this a type of linear search?