File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes Two Dementional Spiral Fill Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Two Dementional Spiral Fill" Watch "Two Dementional Spiral Fill" New topic
Author

Two Dementional Spiral Fill

Lance Leathers
Greenhorn

Joined: Feb 14, 2008
Posts: 1
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
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
Welcome to the Ranch.

Please post what you have got so far; we don't simply hand out answers to that sort of question. Read this.
I am not sure what the difference between spiral filling and ordinary filling is.
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 36478
    
  16
I think I have worked out what you mean by spiral filling. I tried it and failed. It's bl**d* difficult.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Two Dementional Spiral Fill
 
Similar Threads
Question on array declaration:
Multi Dementional Array
define a array
Sorting an array
Recursion