JPComputer Science
Jules P.
Bootcamp mentor
Imagine standing in a line and you want to know your position. You can't see the front, so you tap the person ahead and ask 'what number are you?' They ask the person ahead of them, and so on.
The person at the very front knows their number is 1 — that's the stopping point. Then everyone adds one and passes the answer back. That passing-the-question-forward and answers-coming-back is recursion.
140 people understood this