-5

Possible Duplicate:
Looping in a spiral

Given a grid of any height and width, write an algorithm to traverse it in a spiral. (Starting at the top left and ending in the middle) without passing over previously visited nodes. Without using nested loops.

Community
  • 1
  • 1
Mahdi Yusuf
  • 19,931
  • 26
  • 72
  • 101

1 Answers1

-2

it should be done using one for loop and starting from bottom left, I'am in that coarse

David
  • 1