An Introduction to Recursive Thinking in Computer Science

A step-by-step guide to approach this foundational programming concept and ace your next software engineering interview.

Murtaza Ali
CodeX

--

Photo by Glitch Lab App on Unsplash

Recursion is a foundational topic in introductory programming — one that students tend to struggle with quite a bit. At a high level, it’s a style of programming which involves a function calling itself. However, recursive thinking is a bit more general. It influences the design of complex divide-and-conquer algorithms, as well as affects one’s ability to understand dynamic programming (which is more space-efficient than direct recursion and a common topic on software engineering interviews).

In this article, I will provide a step-by-step guide to approaching recursive problems in computer science. It’s particularly targeted toward those who are still learning computer science fundamentals and are preparing for a formal assessment of their skills. You’ll find it most useful if you meet the following two criteria:

  • You already have a minimal understanding of recursion and have attempted recursive problems before.
  • You are a student or new graduate preparing for a software engineering job interview or perhaps an important examination.

--

--

Murtaza Ali
CodeX
Writer for

PhD student at the University of Washington. Interested in human-computer interaction, data visualization, and computer science education.