10-Recursion

0.0(0)
studied byStudied by 0 people
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

Flashcards about recursion, recursive functions, and related concepts

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

13 Terms

1
New cards

Recursion

A powerful technique for breaking up complex computational problems into simpler ones, where the 'simpler one' is the solution to the whole problem!

2
New cards

Recursive Function

A function that calls itself, reducing the problem a bit on each call.

3
New cards

Two Key Requirements for Recursive Function

Every recursive call must simplify the task in some way; there must be special cases to handle the simplest tasks directly so that the function will stop calling itself.

4
New cards

Triangle number

The sum of 1’s in a triangular pattern, or the area of a triangle of height n.

5
New cards

Infinite Recursion

Occurs when a function calls itself without a proper end test or when the test to end never becomes true, leading to resource exhaustion.

6
New cards

Palindrome

A string that is equal to itself when you reverse all characters.

7
New cards

Recursive Helper Function

A function that is used to simplify a recursive solution by changing the problem slightly, often by using substring inputs rather than complete strings.

8
New cards

Fibonacci sequence

A sequence of numbers where each value is the sum of the two preceding values: f1 =1, f2=1, fn = fn-1 + fn-2.

9
New cards

Permutation

A rearrangement of the letters in a string.

10
New cards

Mutual Recursion

A type of recursion where a set of cooperating functions calls each other in a recursive fashion.

11
New cards

Expression

Either a term, or a sum or difference of terms.

12
New cards

Term

Either a factor, or a product or quotient of factors.

13
New cards

Factor

Either a number or an expression enclosed in parentheses.