plaese help me?????


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: plaese help me?????

  1. #1
    Join Date
    May 2007
    Posts
    2

    Angry plaese help me?????

    Hi...
    Could anyone help me to understand recursion, I don't understand the concept of it and how it does work????
    I have exam tommorow,

  2. #2
    Join Date
    Jan 2007
    Posts
    145
    Code:
    int fact(int n)
    {
    if(n <=1) return 1;
    return(n*fac(n-1));
    }
    fac(5) will 5*fac(4) , fac(4) will call 4*fac(3) ...
    fac(1) will return 1; so it bottom up, same function is called with different argument in different stack space.

  3. #3
    Join Date
    May 2007
    Posts
    2
    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center