473,750 Members | 2,190 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

a recursion function help

hi

can anybody give me a web that I can learn about a recursion function

I don't really understand it

Jul 19 '05 #1
4 3480
M Hayouka wrote:
hi

can anybody give me a web that I can learn about a recursion function

I don't really understand it


Try using a web search engine, such as http://www.google.com

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book

Jul 19 '05 #2
???????


"Thomas Matthews" <Th************ **********@sbcg lobal.net> wrote in message
news:k3******** *********@newss vr33.news.prodi gy.com...
M Hayouka wrote:
hi

can anybody give me a web that I can learn about a recursion function

I don't really understand it


Try using a web search engine, such as http://www.google.com

--
Thomas Matthews

C++ newsgroup welcome message:
http://www.slack.net/~shiva/welcome.txt
C++ Faq: http://www.parashift.com/c++-faq-lite
C Faq: http://www.eskimo.com/~scs/c-faq/top.html
alt.comp.lang.l earn.c-c++ faq:
http://www.raos.demon.uk/acllc-c++/faq.html
Other sites:
http://www.josuttis.com -- C++ STL Library book


Jul 19 '05 #3

"M Hayouka" <Ha*****@bezeqi nt.net> wrote in message
news:3f******** @news.bezeqint. net...
| > > can anybody give me a web that I can learn about a recursion function
| > >
| > > I don't really understand it

Well, the definition of recursion in programming terms is pretty simple:
whenever a function calls itself, it is a recursive function.

Usually, this technique is used to break-down a problem
where you need to repeat the same operation multiple
times on different inputs, until a certain goal
has been found (there has to be an end-condition,
or you have infinite recursion ==> program crash).

Examples are the traversal of binary trees, or the
computations of some mathematical functions:

unsigned long factorial( long i )
{
if(i<=1) return 1;
else return i * factorial(i-1);
}

If you are confused by what a 'factorial' or a 'binary tree' is,
you probably should read about these concepts first.
I hope this helps as a start. Note also that 'recursion' is
definitely not a C++-specific question. In the first place,
it is a common mathematical concept...
hth
--
http://www.post1.com/~ivec <> Ivan Vecerina


Jul 19 '05 #4
Thank you very much,
"Ivan Vecerina" <iv**@myrealbox .com> wrote in message
news:3f******** @news.swissonli ne.ch...

"M Hayouka" <Ha*****@bezeqi nt.net> wrote in message
news:3f******** @news.bezeqint. net...
| > > can anybody give me a web that I can learn about a recursion function | > >
| > > I don't really understand it

Well, the definition of recursion in programming terms is pretty simple:
whenever a function calls itself, it is a recursive function.

Usually, this technique is used to break-down a problem
where you need to repeat the same operation multiple
times on different inputs, until a certain goal
has been found (there has to be an end-condition,
or you have infinite recursion ==> program crash).

Examples are the traversal of binary trees, or the
computations of some mathematical functions:

unsigned long factorial( long i )
{
if(i<=1) return 1;
else return i * factorial(i-1);
}

If you are confused by what a 'factorial' or a 'binary tree' is,
you probably should read about these concepts first.
I hope this helps as a start. Note also that 'recursion' is
definitely not a C++-specific question. In the first place,
it is a common mathematical concept...
hth
--
http://www.post1.com/~ivec <> Ivan Vecerina


Jul 19 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
1890
by: Jakle | last post by:
Hi all. Need alittle help here. This is an example from "How to Think Like a Computer Scientist: Learning with Python, Chapter 5". It's an open source ebook, so if you feel like it you can find it here: http://www.ibiblio.org/obp/thinkCSpy/ The example uses factorials to explain more complex recursion. "Explanation From the Book Begins Here"++++++++++++++++++ >def factorial(n):
43
4168
by: Lorenzo Villari | last post by:
I've tried to transform this into a not recursive version but without luck... #include <stdio.h> void countdown(int p) { int x;
19
2286
by: Kay Schluehr | last post by:
http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/496691
1
17584
by: Sylaris | last post by:
hi, i have a problem which recursion fits perfectly, however; after working with the base function (which has no errors and works correctly) the recursions return a "function not defined" error in ff's js console. i tried a few things that came to mind but nothing has changed it... i found some interesting articles on the net regarding javascript's callbacks, and found out that due to callbacks recursion may end up eating a lot more memory than...
13
4527
by: robert | last post by:
My code does recursion loops through a couple of functions. Due to problematic I/O input this leads sometimes to "endless" recursions and after expensive I/O to the Python recursion exception. What would be a good method to detect recursion loops and stop it by user-Exception (after N passes or some complex criteria) without passing a recursion counter parameter through all the funcs? Robert
24
2547
by: proctor | last post by:
hello, i have a small function which mimics binary counting. it runs fine as long as the input is not too long, but if i give it input longer than 8 characters it gives RuntimeError: maximum recursion depth exceeded in cmp i'm not too sure what i am doing improperly. is there really a lot of recursion in this code?
15
1443
by: Gigs_ | last post by:
Can someone explain me this if l == : return else: return f(l) + l # <= cant figure this, how is all sum at the end? thanks!
20
2997
by: athar.mirchi | last post by:
..plz define it.
30
8304
by: Jeff Bigham | last post by:
So, it appears that Javascript has a recursion limit of about 1000 levels on FF, maybe less/more on other browsers. Should such deep recursion then generally be avoided in Javascript? Surprisingly, deep recursion actually isn't that slow for what I'm doing. Programming this task recursively is so much more straightforward to me, but currently I'm forced to use an ugly hack to avoid going over the 1000 level limit. Of course, it could...
35
4737
by: Muzammil | last post by:
int harmonic(int n) { if (n=1) { return 1; } else { return harmonic(n-1)+1/n; } } can any help me ??
0
8836
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9394
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9338
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9256
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6803
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6080
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4885
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3322
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2798
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.