DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

+ Reply to Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Mar 2007
    Posts
    2

    Thumbs up n dimension spiral matrix

    Let A be an array of (n) elements. Write a procedure which will také this array as input and return a matrix which will be spiral in nature. i.e.

    if A= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] then


    fn(A)= B

    =

    7 8 9 10

    6 1 2 11

    5 4 3 12

    16 15 14 13

    although i could easily handle the problem for a 2 dimension matrix the problem has to be solved in 3 dimension as well as n dimension.

    i'm finding it difficult to visualize the same problem for 3 dimension and then for n dimension.
    can som1 help me?

    thank u
    Eshwar

  2. #2
    Join Date
    Dec 2003
    Posts
    3,366
    there are several options for 3-d. You need to get an example of what it would look like in 3-d (you cannot be expected to produce output until that output has been clearly defined).

  3. #3
    Join Date
    Sep 2009
    Posts
    1
    Quote Originally Posted by eshwar_gunner99 View Post
    Let A be an array of (n) elements. Write a procedure which will také this array as input and return a matrix which will be spiral in nature. i.e.

    if A= [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16] then


    fn(A)= B

    =

    7 8 9 10

    6 1 2 11

    5 4 3 12

    16 15 14 13

    although i could easily handle the problem for a 2 dimension matrix the problem has to be solved in 3 dimension as well as n dimension.

    i'm finding it difficult to visualize the same problem for 3 dimension and then for n dimension.
    can som1 help me?

    thank u
    Eshwar
    can you help me to handle this problem for a 2 dimension matrix in C
    thanx in advance

Similar Threads

  1. sorting
    By krazykrisi in forum C++
    Replies: 3
    Last Post: 01-25-2007, 11:59 AM
  2. Matrix Problem in C++
    By emmanuella in forum C++
    Replies: 2
    Last Post: 11-23-2006, 05:07 PM
  3. help with sparse matrix
    By jrhaley123 in forum Java
    Replies: 7
    Last Post: 11-19-2005, 07:18 PM
  4. a hollow circle from an asterisc matrix
    By sarahabbi in forum Java
    Replies: 0
    Last Post: 07-05-2005, 12:20 AM
  5. Free ASP.NET Web Matrix Design/Editor Tool Released
    By ASPSmith Training in forum dotnet.announcements
    Replies: 0
    Last Post: 06-18-2002, 03:39 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


Top DevX Stories

Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL


Sponsored Links