Minimum distance required to turn at maximum speed of an F-16 What would be the minimum distance required for an F-16 to turn either sideways or upwards in order to avoid a collision (assume an infinitely long wall both length and breadth wise). 

Also would it be better for such planes to turn sideways or upwards? Which is faster and requires less distance.
According to this F-16 turn performance chart, at the rated maximum airspeed of 800 knots, an F-16 can turn at about 10.5 degrees per second, so a 90° turn would take about 8.5 seconds. The turn radius would be 9,000 feet. Since you specified a 90° turn to avoid an infinite wall, the pilot would have to start their turn at or before 9,000 feet from the wall in order to avoid a collision.

However, this doesn't tell the whole story. The F-16 can't maintain speed in such a turn, and the reduced speed would in turn reduce the turning radius. If the plane, for whatever reason, absolutely had to maintain its maximum speed, then it would be limited to a turn rate of 3.5 degrees per second and a turning radius of 25,000 feet.