News

Also, a recursive algorithm can always be implemented iteratively ... I say this because a while loop is equivalent to a tail recursive function and recursive functions need not be tail recursive.
Yes/No’ say what the total is This algorithm would keep iterating until the answer at the end of the loop is ‘No’, ie it will continue to iterate WHILE there are more numbers to add.
While that’s true ... factoring in that the choice was in fact an output shown by the algorithm. This creates a feedback loop, where the output of the algorithm becomes part of its input.