Results 1 to 4 of 4
  1. #1
    javasucks2009 is offline Member
    Join Date
    Mar 2009
    Posts
    9
    Rep Power
    0

    Unhappy pleasee help me out for this recursive question!!!

    can u help me to do coding for the question pleaseee!!!?

    can u guys help me to do the coding for the question pleaseeeee!!?

    Question:

    Write a program that prints the elements of an array of size 11 in the reverse order. Use a recursive method
    that takes as parameters the array and the size of the array to print it in reverse.

    //prints the elements in the reverse order
    Void printReverse (int a[], int n)

    thanks


    Andy

  2. #2
    angryboy's Avatar
    angryboy is offline Senior Member
    Join Date
    Jan 2009
    Posts
    742
    Rep Power
    10

    Default

    and what have you done so far?
    USE CODE TAGS--> [CODE]...[/CODE]
    Get NotePad++ (free)

  3. #3
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    10

    Default

    this has to be the worst use of recursion you can assign someone in java

  4. #4
    javasucks2009 is offline Member
    Join Date
    Mar 2009
    Posts
    9
    Rep Power
    0

    Default

    i ve done it!!!



    int a[] = new int[] {1,2,3,11,2,5,6,7,8,10,12};
    printReverse (a,11);



    }



    public static void printReverse(int a[],int n) {

    if (n == 0 ){
    System.out.println("There is no value to return");
    }
    else if (n > 0){
    System.out.println("The elements in the reverse order "+a[n-1]);
    printReverse(a, n-1);

    }
    }
    }

Similar Threads

  1. Guys help me with recursive pleaseeee!!
    By javasucks2009 in forum Advanced Java
    Replies: 13
    Last Post: 03-22-2009, 04:37 AM
  2. Recursive Counting
    By zlwilly in forum New To Java
    Replies: 1
    Last Post: 01-29-2009, 09:42 PM
  3. Recursive Method
    By bluegreen7hi in forum New To Java
    Replies: 5
    Last Post: 11-29-2007, 05:45 AM
  4. Recursive Anagram
    By zoe in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 07:15 AM
  5. Help with recursive implementation
    By toby in forum Advanced Java
    Replies: 1
    Last Post: 08-07-2007, 06:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •