Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: aray print

  1. #1
    Junior Member
    Join Date
    Feb 2014
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default aray print

    1 2 3 4 5
    6 7 8 9 10
    11 12 13 14 15
    16 17 18 19 20
    21 22 23 24 25




    output should be in zig zag like
    1 6 2 3 7 11 16 12 8 4 5 9 13 17 21 22 18 14 10 15 19 23 24 20 25


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    6,387
    My Mood
    Mellow
    Thanks
    257
    Thanked 789 Times in 774 Posts

    Default Re: aray print

    Just to give you something to think about:

    The sequence you've described is each of the minor diagonals in reverse order in the subarrays:

    [0, 0] [0, 0]
    [0, 0] [1, 1]
    [0, 0] [2, 2]
    . . .
    [0, 0] [5, 5]
    [1, 1] [5, 5]
    . . .
    [5, 5] [5, 5]

    So you might write a method to find the subarrays and then a method to find the elements in the minor diagonal of the resulting subarrays in reverse order.

Similar Threads

  1. print A-Z without O I J
    By Billzhang in forum What's Wrong With My Code?
    Replies: 9
    Last Post: December 15th, 2013, 06:57 AM
  2. CANT PRINT
    By yahel_s7 in forum Java IDEs
    Replies: 5
    Last Post: November 1st, 2013, 07:16 AM
  3. CANT PRINT
    By yahel_s7 in forum What's Wrong With My Code?
    Replies: 2
    Last Post: October 31st, 2013, 01:59 PM
  4. Replies: 1
    Last Post: December 3rd, 2012, 02:35 PM
  5. xfa.host.print: print a page + some page range.
    By gammaman in forum Totally Off Topic
    Replies: 2
    Last Post: May 10th, 2012, 09:07 AM