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: Arrange the elements of 2 arrays and store in a third array without using sorting techniques

  1. #1
    Junior Member
    Join Date
    Oct 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question Arrange the elements of 2 arrays and store in a third array without using sorting techniques

    Write a program in java to take 2 arrays(say ar[] and ar1[]) having numbers stored in ascending order in both. Take a third array(say ar2[]) to store the elements of both the previous arrays so that the resulting elements are also in ascending order.

    Example:
    ar[]={2,4,6,8}
    ar1[]={3,5,7,9}
    ar2[]={2,3,4,5,6,7,8,9}

    NOTE: No sorting techniques allowed and no 4th array must be taken

    Please help me in this program...


  2. #2
    Super Moderator
    Join Date
    Jun 2013
    Location
    So. Maryland, USA
    Posts
    5,310
    My Mood
    Mellow
    Thanks
    194
    Thanked 669 Times in 656 Posts

    Default Re: Arrange the elements of 2 arrays and store in a third array without using sorting techniques

    Think about how you'd do it in your head and/or with pencil and paper. Write down the steps and try it out on paper. Once you think you understand the paper approach, begin to program that process, taking it a step at a time.

Similar Threads

  1. Arrays sorting
    By LeeDD in forum What's Wrong With My Code?
    Replies: 13
    Last Post: March 4th, 2013, 02:17 PM
  2. Sorting using Iterator
    By palaboui in forum Collections and Generics
    Replies: 1
    Last Post: November 15th, 2012, 01:59 PM
  3. [SOLVED] Sorting Strings
    By userct in forum Algorithms & Recursion
    Replies: 17
    Last Post: February 28th, 2012, 09:03 AM
  4. Sorting ArrayList
    By leao in forum What's Wrong With My Code?
    Replies: 2
    Last Post: January 31st, 2011, 02:33 PM
  5. [SOLVED] sorting
    By kite98765 in forum Algorithms & Recursion
    Replies: 8
    Last Post: February 4th, 2010, 07:34 AM

Tags for this Thread