Relative Content

Tag Archive for recursion

Taking looped inputs and outputs

Think of me trying to make a program that goes on to calculate Fibonacci numbers in a sequential order forever. I want to make the command produce output and treat the output as an input by performing some operation on it. How would I write such a program in python and how would I get it to stop if it’s not going to automatically stop after a certain point?

Why is this function returning 5? Why is it not performing a factorial?

let num = 4; let value = 1; function factorial(num) { if (num > 0) { value *= num; return value; } return factorial(num–); } console.log(factorial(5)); I was trying to write a factorial function using recursion but this function is returning 5? recursion New contributor Jyotiska Saha is a new contributor to this site. Take […]

Verify 0 or 2+ sub sections in a section

There is a rule in writing: When you break a section into subsections, typically it should have more than one subsection. This goes back to the old high school composition rules: if you have an A. section you also need a B. section.

Verify 0 or 2+ sub sections in a section

There is a rule in writing: When you break a section into subsections, typically it should have more than one subsection. This goes back to the old high school composition rules: if you have an A. section you also need a B. section.

How can Lisp produce an iterative process from a recursive procedure?

I am starting to learn Lisp, using the SICP book. The authors mention that a procedure (i.e. function) can be recursive or iterative. Additionally, the process those procedures will generate will also be recursive or iterative, and that, surprisingly, a recursive procedure can sometimes generate an iterative process.

How can Lisp produce an iterative process from a recursive procedure?

I am starting to learn Lisp, using the SICP book. The authors mention that a procedure (i.e. function) can be recursive or iterative. Additionally, the process those procedures will generate will also be recursive or iterative, and that, surprisingly, a recursive procedure can sometimes generate an iterative process.

How can Lisp produce an iterative process from a recursive procedure?

I am starting to learn Lisp, using the SICP book. The authors mention that a procedure (i.e. function) can be recursive or iterative. Additionally, the process those procedures will generate will also be recursive or iterative, and that, surprisingly, a recursive procedure can sometimes generate an iterative process.

How can Lisp produce an iterative process from a recursive procedure?

I am starting to learn Lisp, using the SICP book. The authors mention that a procedure (i.e. function) can be recursive or iterative. Additionally, the process those procedures will generate will also be recursive or iterative, and that, surprisingly, a recursive procedure can sometimes generate an iterative process.