There is an arbirarly long line of unknown size. You are standing at a particular point you can either move 1 step forward or 1 step backward. You have to search for an object in that line. Your object can be in any direction. Give an optimal solution.
A search might be 1 step forward, 2 back and so on.
Can you do better than that? What would be an efficient search pattern?