can s/o plz give a simple example of how recursion can be used in programming....im new to this topic so i need help i cant develop new codes myself.
Rabex
0
Newbie Poster
Recommended Answers
Jump to PostA function to calculate factorials in math is a common example of recursion. The function calls itself until it reaches its "base case", which in the factorial example is n=0.
Jump to PostLinked list and binary tress use recursion
Jump to Postit was what I did when I first learned about recursion
Yes, me too. Those examples are fine for learning how recursion works, but not for how it can be best used in real code. I think that is what the question was about, and that is why I replied …
All 9 Replies
Grn Xtrm
84
Posting Pro in Training
gerard4143
371
Nearly a Posting Maven
mrnutty
761
Senior Poster
Tom Gunn
1,164
Practically a Master Poster
Grn Xtrm
84
Posting Pro in Training
Tom Gunn
1,164
Practically a Master Poster
Grn Xtrm
commented:
Your 100% right :)
+1
mrnutty
761
Senior Poster
Tom Gunn
1,164
Practically a Master Poster
mrnutty
761
Senior Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.