Recursion and Advanced Data Structures

In the previous module, you learned about various data structures such as hash tables and dynamic arrays, and learned the profile of these data structures in terms of their time complexity.

In this module, you'll learn about a basic mechanism that has given rise to many interesting data structures and algorithms: recursion. Throughout this module, you will learn what recursion is and how to implement it in your program. Recursion doesn't always deal with algorithms, it is also used in data structures such as linked lists.

As this module progresses, we'll discuss what recursion is, why it's useful, and how to use it to replace loops in your programs (where applicable). You'll learn several important concepts such as recursion, recursive data structures, linked lists, and more!

Recursion can be a difficult concept to grasp at first, but it's a very rewarding and fun tool once you understand it. You’ll get to apply what you’ve learned from within your browser — there's no need to use your own machine to do the exercises. The Python environment inside of this course includes answer checking so you can ensure that you've fully mastered each concept before learning the next.


  • Learn how recursion lets us express logic more compactly.
  • Learn how to create recursive algorithms.

Mission Outline

1. Recursion
2. A Recursive look at Factorials
3. Base Cases
4. Visualization of Recursion
5. Fibonacci
6. Linked Lists - A Recursive Data Structure
7. Exercise: Find the Length of a Linked List
8. Linked List Insertion and Deletion
9. Exercise: Linked List Time Complexity
10. Takeaways


Course Info:


The median completion time for this course is 6.16 hours. ​View Details​​​

This course requires a premium subscription. This course includes five missions, and one guided project. It is the 26th course in the Data Scientist in Python path.


Take a Look Inside

(function(d) { d.addEventListener("DOMContentLoaded", function() { var pathname = d.location.pathname.replace(/^[/]|[/]$/g, "").replace("/", "-"); var tags = d.getElementsByTagName("iframe"); var type = pathname.startsWith("course") ? "?course=" : pathname.startsWith("path") ? "?path=" : null; if (type) { var i; for (i = 0; i < tags.length; i++) { if (tags[i].src.indexOf("signup#iframe") !== -1) { tags[i].src = tags[i].src.replace("#iframe", "") + type + pathname + "#iframe"; } } } }, false); })(document);