Recursive Function

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

1/18

flashcard set

Earn XP

Description and Tags

Algorithm and Complexity

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced

No study sessions yet.

19 Terms

1
New cards

Recursion

It is a method of solving a problem by breaking it down into smaller subproblems

2
New cards

The Three Laws of Recursion

  1. Must have a Base Case

  2. Must change state and move toward the base case

  3. Must call itself recursively

3
New cards

Conditions

These are used to start, continue, and stop the algorithm.

  • The start and continue can be the same

  • The stop is considered a base case

4
New cards

Call Stack

Managing function calls and keep track of program execution.

5
New cards

Direct Recursion

A function that calls itself from within

6
New cards

Indirect Recursion

More than one function calls another in a circular manner

7
New cards

Tail Recursion

The call is the last statement that is executed

8
New cards

Head Recursion

The call is the first statement that is executed

9
New cards

Tree Recursion

Calls itself multiple times

10
New cards

Nested

Recursion in a Recursion

11
New cards

Form 1

knowt flashcard image
12
New cards

Form 2

knowt flashcard image
13
New cards

Form 3

<img src="https://knowt-user-attachments.s3.amazonaws.com/2b7efe59-c923-4260-acaa-f29e3fee593b.png" data-width="100%" data-align="center"><p></p>
14
New cards

Form 4

knowt flashcard image
15
New cards

Tail Recursion - Visual Representation

knowt flashcard image
16
New cards

Head Recursion - Visual Representation

knowt flashcard image
17
New cards

Tree Recursion - Visual Representation

knowt flashcard image
18
New cards

Nested Recursion - Visual Representation

knowt flashcard image
19
New cards

Indirect Recursion - Visual Representation

knowt flashcard image