Hello, could someone explain recursion to me?
It would be much appreciated!
pwolf 14 Junior Poster in Training
Recommended Answers
Jump to PostIt's not a real life program, it's an academic exercise. Basic recursion is related to the mathematical notion of 'induction formula'. Here the more obvious induction formula is that
x ** y = x * (x ** (y-1))
. From this idea, you should be able to write a recursive …
Jump to PostAlright, try to think algorithmically. Here is a pseudo code procedure to compute x raised to the power of y
to compute x raised to the power of y: check that y is an integer >= 1 if y == 1: return x else: compute x raised …
All 8 Replies
zeroliken 79 Nearly a Posting Virtuoso
pwolf 14 Junior Poster in Training
Gribouillis 1,391 Programming Explorer Team Colleague
pwolf 14 Junior Poster in Training
Gribouillis 1,391 Programming Explorer Team Colleague
TrustyTony 888 ex-Moderator Team Colleague Featured Poster
Gribouillis 1,391 Programming Explorer Team Colleague
TrustyTony 888 ex-Moderator Team Colleague Featured 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.