+ 2
Recursive to Iterative
How to convert a recursive function into iterative?
2 Respostas
0
Where’s your attempt?
0
Take hofstadter's Q-sequence as example.
Q(1)=q(2)=1
Q(n)=Q(n-Q(n-1))+Q(n-Q(n-2))
How to convert a recursive function into iterative?