Results 1 to 3 of 3

Thread: stackOverflowError

  1. #1
    Zurine Xeveria is offline Junior Member
    Join Date
    Aug 2009
    Posts
    20
    Rep Power
    0

    Default stackOverflowError

    Hi I am new in forum. I am first year MCA student. In my syllabus I have DATA STRUTURE subject is there. I have little bit knowledge of stack but I want to know about stackoverflow and random function in data structure. I tried to search in many forums but I am not able get the answer. If you are having any suggestions then reply me. It can helpful to me.

  2. #2
    Kesare Julina is offline Junior Member
    Join Date
    Sep 2009
    Posts
    28
    Rep Power
    0

    Default

    Refer following program to stackoverflow and random function:
    Code:
    Public static int fc_rc(int i) {
       if(i < 0) { return -1; / * Error * / }
       else if(i ==0 | | I == 1) { return 1; }
       else { return i * fc_rc(i-1); } / * Here we have the recursive call * /
    }
     
    Public static int fc_it(int i) {
       if(i < 0) { return -1; / * Error * / }
       int rs = 1;
       while(i> 1) {
          rs *= i;
          i -;
       }
       return rs;
    }

  3. #3
    Alberik Benedikt is offline Junior Member
    Join Date
    Sep 2009
    Posts
    26
    Rep Power
    0

    Default

    The stackoverflow is generally as of an infinite recursion. Not depending on the version of JVM used it is possible that there is a limit more or less accessible object. You have to try to make sure that you return your random, it is quite possible that at one time or another he will form a loop that reasons the error.

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
  •  
SEO by SubmitEdge

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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48