For the first quiz, I don't understand the explanation to problem 1.2. I thought that if any problem could be solved by recursion/iteration, it must complete in a finite amount of time, i.e have a finite amount of recursions/iterations. Thus, I could technically just write those finite number of commands in a code, avoiding recursion. It'd be annoying, but it'd be possible. Thus I put true instead of false. Can anyone help with this???
The question, by the way is: True or False, There exist problems that cannot be solved in Python without using either iteration or recursion.
And the given explanation is "True. Otherwise the complexity of programs would be bound by the length of code"
is true because one programs start iterative (most efficient) and can transform in recursive (less code)
the question is implying that there are problems that CAN be solved without using iteration and is asking if there are problems that can NOT be solved without iteration/recursion. in other words, are there problems that require iteration/recursion to solve them. can you add the numbers in a list without iteration? does adding the numbers in a list require iteration?
Join our real-time social learning platform and learn together with your friends!