What is a base case in a recursive function?

Advertisement

  • A base case is the condition that allows the algorithm to stop recursing. It is usually a problem that is small enough to solve directly.
  • The base case is summary of the overall problem that needs to be solved.
  • The base case is passed in as an argument to a function whose body makes use of recursion.
  • The base case is similar to a base class, in that it can be inherited by another object.
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment


Share via
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend