Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
The instructor tricked you with the term "base case", there is no such term in common use (in recursion).
There can be any number of conditional statements (usually, at least one).
Correctness of the solution != optimality of the solution. Therefore, any code can be considered "correct" if it gives the correct solution to the problem, taking into account the terms of reference.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question