Module 6: Recursion Lecture Notes

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

1/13

flashcard set

Earn XP

Description and Tags

Practice flashcards covering the definitions, logic, and mathematical applications of recursion as presented in the Module 6 lecture.

Last updated 8:30 AM on 7/6/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai
Chat

No analytics yet

Send a link to your students to track their progress

14 Terms

1
New cards

Recursive Call

A function call in which the function being called is the same as the one making the call.

2
New cards

Recursion

A powerful programming technique in which procedures and functions call themselves, used in place of iteration (looping).

3
New cards

Infinite Recursion

A recursive function that lacks code to stop it from repeating, causing it to act like an infinite loop.

4
New cards

Depth of Recursion

The number of times a function calls itself before reaching a base case; for example, a call to message(5) results in a depth of 6 if it terminates at 0.

5
New cards

Base Case

The case for which a solution is explicitly known and can be stated non-recursively, allowing a recursive function to terminate.

6
New cards

General Case

The case for which the solution is expressed in a smaller version of itself, also known as the Inductive Step Case or recursive case.

7
New cards

numChars function

A recursive function used to count occurrences of a character in a string using parameters for the search character, the string array, and the starting subscript.

8
New cards

Direct Recursion

Examples of recursive functions that directly call themselves.

9
New cards

Indirect Recursion

A programming situation that occurs when function A calls function B, which in turn calls function A.

10
New cards

Factorial Recursive Definition

Mathematically defined as Factorial(n)=n×Factorial(n1)Factorial(n) = n \times Factorial(n - 1) if n>0n > 0, and 11 if n=0n = 0.

11
New cards

Greatest Common Divisor (GCD)

Using Euclid's Algorithm, GCD(x,y)GCD(x, y) is yy if yy divides xx evenly; otherwise, it is GCD(y, x \text{ % } y), where x \text{ % } y is the remainder of x/yx/y.

12
New cards

Fibonacci Series

A sequence of numbers defined as F0=0F_0 = 0, F1=1F_1 = 1, and FN=FN1+FN2F_N = F_{N-1} + F_{N-2} for N×2N \times 2.

13
New cards

FloatList::countNodes

A recursive linked list operation where the base case returns 0 if the pointer is NULL, and otherwise returns 1+countNodes(nodePtr->next)1 + \text{countNodes(nodePtr->next)}.

14
New cards

FloatList::showReverse

A recursive operation that displays linked list nodes in reverse order by calling itself for the next node before printing the current node's value.