← Back to the Introduction to Computer Science outline The Course Maker
← Introduction to Computer Science outline
Week 14 · Readings & resources

Week 14 — Readings & Resources

Introduction to Computer Science Free sample edition

Your primary reading is Chapter 14 (in this module). Everything below is the optional, go-deeper layer — pick what helps, skip the rest.

How to use this page

This page has 10 items (4 readings and 6 videos). Allow 74–87 minutes for everything. Each group points back to the matching chapter section and class-session segment, so use the full menu when you want more, or take the quick path below.

Every video here has captions: turn them on with the CC button in the player. The chapter covers the same ideas in text.

Pick-one quick path (20–23 min total)

① Giving a recursive function its two parts

Chapter 14, Section “Give it two parts: the base case and the recursive case” · Session 1, Segment 2, “Base case and recursive case” · Remember: the base case answers without calling again, and every recursive call must move toward it.

  • Recursion, MDN Web Docs Glossary — Mozilla — a short glossary entry that names the base case and the recursive case and shows a small Python function that counts down; read the definition and the first example, and skip the later examples, which are written in JavaScript. Use it while working through the Week-14 module overview. (reading, 5–8 min)
  • Learn RECURSION in 5 minutes! — Bro Code — a quick demo that writes the same walking-steps program as a loop and as a function that calls itself; before each run, find the base case and predict which line prints first. (video, 6 min) (captions: automatic)
  • What on Earth is Recursion? — Computerphile — an explainer that compares recursion to a dream inside a dream and sets out to make the idea easier to hold; listen for where the chain of calls stops, and match it to the chapter's base case. (video, 10 min) (captions: creator)

② Watching the call stack pile up and unwind

Chapter 14, Section “Watch the call stack pile up and unwind” · Session 1, Segment 4, “The call stack” · Remember: every call adds a frame with its own n, and the frames come off in reverse order as the calls return.

  • Python For Beginners - Recursion Explained — TeachingCS — a chaptered lesson that defines recursion, works an example, shows how a stack keeps track of function calls, and ends with a run that stops with RecursionError, which the video calls a stack overflow and blames on running out of memory; in Python the stop comes from the interpreter's depth limit, a setting, as Chapter 14's Section 8 explains. This builds on Week 7's work with functions, return values, and frames. (video, 9 min) (captions: automatic)
  • How Recursion Works? - Explained with animation. — Live To Code — a three-minute animation that traces a recursive Fibonacci function as its calls start and return; that function calls itself twice per call, a shape this course leaves for a later course, and its stack picture also holds calls that have not started yet, unlike the chapter's frames, so use it for the idea of calls waiting and returning, check the frame picture in Python Tutor, and pause it partway to say which call will finish next. (video, 3 min) (captions: automatic)
  • Python Recursion, Recursive Function — Programiz — a plain-text tutorial with a recursive factorial, a note on why every recursive function needs a condition that stops it, and an example that ends in RecursionError; the page names a default depth, which is a setting that varies, so treat it as a detail rather than a fact to memorize. (reading, 8–12 min)

③ Solving one problem by recursion and by a loop

Chapter 14, Section “Solve it both ways: recursion versus iteration” · Session 2, Segment 6, “Recursion versus iteration” · Remember: a recursion and a loop can compute the same answer, so write both and run both when you are unsure.

  • Python: RECURSION Explained — Programming and Math Tutorials — a chaptered walkthrough that finds 5 factorial first with a loop and then with a recursive function, and closes with the pros and cons of each; check that both versions reach the same answer. (video, 9 min) (captions: automatic)
  • Programming Loops vs Recursion — Computerphile — a talk on loops versus recursion that argues loops are great but reach a point where they are not enough; weigh that claim against the chapter, where a loop and a recursion both printed 15. (video, 13 min) (captions: creator)
  • Python Recursion — W3Schools — a tutorial page with a countdown, a factorial, and recursion over a list, each with a base case and a recursive case; read those three examples and the part on the depth limit, and skip the Fibonacci section, which goes beyond this week. (reading, 8–12 min)

Optional one-stop reference (free online reference)

Heads-up (links rot): these point to outside sites that occasionally move or rename pages. If a link ever fails, tell your instructor and use the reference above in the meantime.

Provenance: Built with The Course Maker · samples.thecoursemaker.com