Introducing recursion by parking cars

  • Authors:
  • Michael Wirth

  • Affiliations:
  • University of Guelph, Guelph, Ontario, Canada

  • Venue:
  • ACM SIGCSE Bulletin
  • Year:
  • 2008

Quantified Score

Hi-index 0.00

Visualization

Abstract

Many approaches to teaching recursion in textbooks focus on classical examples such as Fibonacci, factorial, or the Towers of Hanoi. As established as these algorithms are, they don't really illustrate the potential of recursion. This paper explores the use of a novel recursive algorithm which requires innovative thinking, and the use of random numbers. The algorithm looks at the use of recursion to randomly park cars on a street.