Results 1 to 2 of 2
  1. #1
    fam2315 is offline Member
    Join Date
    Feb 2011
    Posts
    78
    Rep Power
    0

    Default Recursively find average of an integer arrray

    Can someone give me a starting point on how to achieve this?

    I'm thinking something like this structure, but I'm not too sure. Any Ideas?:

    Java Code:
    public double findAvg(int[] input){
    
    for(int i=0; i<input.size(); i++){
    return findAvg(?)
    }
    
    }

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default

    This post may be of use to you - http://www.java-forums.org/blogs/sun...recursion.html

    Are there any special requirements to this assignment? It would be simply if you created two recursive methods, one to sum an array, and one to count an array(which are both examples in that blog post), and a final method which uses both of those recursive methods to compute the average.

Similar Threads

  1. Delete Middle element from arrray
    By tttestall in forum New To Java
    Replies: 3
    Last Post: 04-24-2011, 08:25 PM
  2. Need help to find average
    By kevinsoto in forum New To Java
    Replies: 4
    Last Post: 11-04-2010, 02:54 PM
  3. Replies: 12
    Last Post: 10-31-2010, 07:14 PM
  4. JPanel Array with Color arrray
    By Chanel in forum New To Java
    Replies: 10
    Last Post: 07-31-2010, 03:18 PM
  5. recursively searching through arraylists
    By newtojava7 in forum New To Java
    Replies: 1
    Last Post: 03-17-2008, 03:36 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
  •