Recursion Lecture Notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/10

flashcard set

Earn XP

Description and Tags

Flashcards covering Recursion, Towers of Hanoi, Factorial, and Fibonacci sequences.

Last updated 2:47 AM on 5/16/25
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

11 Terms

1
New cards

Recursion

A way of solving a problem by having a function call itself.

2
New cards

Towers of Hanoi

A problem that can be solved using recursion. For n=3, it consists of 7 moves.

3
New cards

Tower (N, BEG, AUX, END)

A recursive procedure for solving the Towers of Hanoi problem with N disks.

4
New cards

Base Case (Recursion)

Every recursive function must have one or more base cases that define when the recursion stops.

5
New cards

Recursive Case

Defines how the recursive function calls itself with modified arguments to move towards the base case.

6
New cards

Initialization (Recursion)

Proper initialization of parameters and variables is necessary for recursive functions.

7
New cards

Termination (Recursion)

Recursion must terminate after a finite number of steps.

8
New cards

Stack (Recursion)

Recursion uses the system stack to store intermediate results, so it's important to consider the stack depth.

9
New cards

Factorial (Recursive Function)

A recursive function that calculates the factorial of a number. The base case is factorial(0) = 1, and the recursive call is n * factorial(n-1).

10
New cards

Fibonacci Sequence

A sequence where each term is the sum of the two preceding terms (e.g., 0, 1, 1, 2, 3, 5, 8…). F0=0, F1=1, and Fn = Fn-2 + Fn-1.

11
New cards

FIBONACCI (FIB, N)

A procedure that calculates Fn and returns the value in the first parameter FIB. Uses recursion by calling itself with N-2 and N-1

Explore top notes

note
Railroads Notes
Updated 772d ago
0.0(0)
note
2.1 Physical and Mental Health
Updated 1118d ago
0.0(0)
note
Spansih
Updated 527d ago
0.0(0)
note
AP GOV Unit 5
Updated 936d ago
0.0(0)
note
Unit 3 The Atom >
Updated 1048d ago
0.0(0)
note
Railroads Notes
Updated 772d ago
0.0(0)
note
2.1 Physical and Mental Health
Updated 1118d ago
0.0(0)
note
Spansih
Updated 527d ago
0.0(0)
note
AP GOV Unit 5
Updated 936d ago
0.0(0)
note
Unit 3 The Atom >
Updated 1048d ago
0.0(0)

Explore top flashcards

flashcards
Latin 1 Vocab Review
210
Updated 525d ago
0.0(0)
flashcards
Biology Exam Review
98
Updated 1209d ago
0.0(0)
flashcards
Fluid and Electrolytes
24
Updated 1095d ago
0.0(0)
flashcards
APUSH Period 5
110
Updated 556d ago
0.0(0)
flashcards
English Vocab 7
31
Updated 1037d ago
0.0(0)
flashcards
Latin 1 Vocab Review
210
Updated 525d ago
0.0(0)
flashcards
Biology Exam Review
98
Updated 1209d ago
0.0(0)
flashcards
Fluid and Electrolytes
24
Updated 1095d ago
0.0(0)
flashcards
APUSH Period 5
110
Updated 556d ago
0.0(0)
flashcards
English Vocab 7
31
Updated 1037d ago
0.0(0)