turtlegk33

02-15-2008, 04:00 AM

How could i write two methods... one recursive and one not to fill a two dementional array of size n.

ex. 5 x 5 array

0 1 2 3 4

15 16 17 18 5

14 23 24 19 6

12 22 21 20 7

12 11 10 9 8

the non-recursive routine would be like void spiralFill(int [][]a, int n) where it spiral fills the first n rows and columns

ex. 5 x 5 array

0 1 2 3 4

15 16 17 18 5

14 23 24 19 6

12 22 21 20 7

12 11 10 9 8

the non-recursive routine would be like void spiralFill(int [][]a, int n) where it spiral fills the first n rows and columns