Programming fundamentalsLesson 2 of 2 in the course Recursion
Recursive Binary Search, Three Towers, and Coin-Toss Sequences
5 flashcards · 5 quiz questions · 5 match pairs · 4 fill-in sentences · English
Lesson progress
0 / 5
Your progress is kept in this browser only.Sign up to save it
Summary
Recursion can make problems easier to solve by reducing them to smaller versions of the same problem. This lesson explores how recursion searches a sorted list, solves the Three Towers puzzle, and generates every possible sequence of coin tosses.
A linear search may inspect every item in a list. Binary search is faster for a sorted list because each comparison discards about half of the remaining items.
All flashcards
Quiz questions
Based on Introduction to Python Programming by Udayan Das, Aubrey Lawson, Chris Mayfield, Narges Norouzi (OpenStax), licensed CC BY 4.0. Adapted into a summary, flashcards and quizzes.
More in Programming fundamentals
All Programming fundamentals lessonsProgramming fundamentalsTracing Conditional and Function-Call Control Flow5 flashcards · 5 quiz questions · 4 gamesPlay free →Programming fundamentalsWhile Loops: Conditions, Counters, and Input-Controlled Repetition5 flashcards · 5 quiz questions · 4 gamesPlay free →Programming fundamentalsVariable Scope: Global and Local Variables in Python5 flashcards · 5 quiz questions · 4 gamesPlay free →Programming fundamentalsPython Function Arguments, Defaults, and PEP 8 Spacing5 flashcards · 5 quiz questions · 4 gamesPlay free →Programming fundamentalsRecursive Cases and Base Cases in Elementary Math Functions5 flashcards · 5 quiz questions · 4 gamesPlay free →Programming fundamentalsPython's Origins, Design Goals, and Popularity Measures5 flashcards · 5 quiz questions · 4 gamesPlay free →