All problems that are solvable with recursion are solvable with loop, and vice versa.
Is this statement right or proven at all?
sometimes, using recursion causes stack overflow.
if the statement is correct. we’d better use loop instead.
thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes. Loop + Stack will solve all recursion problems.
After all, compiler does that internally. Recursion is nothing but pushing data onto a stack, and later popping from it, done by the compiler.