Recursion: Concepts and Implementation — Topics & Learning Outcomes

📋 Module Topics🎯 Student Learning Outcomes📚 Materials for Each Topic

Module Topics

1. What is Recursion?

Introduces recursion as a programming strategy where a function calls itself to solve a problem. Establishes the conceptual foundation before diving into technical details.

Materials for topic 1 (2)

2. Base Cases and Recursive Cases

Explains the two essential components of any recursive function: the base case that stops recursion and the recursive case that progresses toward it. Covers why both are necessary to avoid infinite loops.

Materials for topic 2 (2)

3. The Call Stack and Recursion

Describes how the call stack manages recursive function calls, tracking execution context at each level. Explores stack frames, stack depth, and the risk of stack overflow.

Materials for topic 3 (2)

4. Implementing Factorial with Recursion

Walks through building a classic recursive factorial function in JavaScript as a concrete first implementation. Connects the mathematical definition of factorial to recursive code structure.

Materials for topic 4 (2)

5. Fibonacci Sequence Using Recursion

Guides students through implementing the Fibonacci sequence recursively in JavaScript, illustrating functions with multiple recursive calls. Discusses the trade-offs of naive recursive Fibonacci in terms of performance.

Materials for topic 5 (2)

6. Recursive List Traversal

Demonstrates how recursion can be applied to traverse and process lists or array structures in JavaScript. Highlights how recursive thinking simplifies problems that involve repeated nested or sequential processing.

Materials for topic 6 (2)

7. When to Use Recursion

Compares recursion to iterative approaches, helping students recognize problem types best suited to recursive solutions. Covers readability, performance considerations, and practical guidelines for choosing recursion.

Materials for topic 7 (2)

Student Learning Outcomes

By the end of this module, students will be able to:

MO1
Distinguish between the base case and recursive case in a recursive function, explaining how each component prevents infinite recursion and stack overflow
Level: AnalyzeType: CognitiveCourse mapping: CO1
MO2
Implement recursive solutions in JavaScript for classic problems including factorial, Fibonacci sequence, and list traversal
Level: ApplyType: BehavioralCourse mapping: CO3
MO3
Trace the growth and resolution of the call stack — including individual stack frames — through a recursive function execution such as factorial(3) or fibonacci(4)
Level: AnalyzeType: CognitiveCourse mapping: CO4
MO4
Evaluate whether a given problem is better solved using recursion or iteration, justifying the selection based on problem structure, readability, and performance considerations
Level: EvaluateType: CognitiveCourse mapping: CO2
MO5
Identify the performance trade-offs of naive recursive implementations, such as redundant subproblem recalculation in the Fibonacci sequence, and describe strategies to mitigate stack overflow risk
Level: AnalyzeType: CognitiveCourse mapping: CO4

Course Outcomes (reference)

CO1Describe both complex and simple data structures.
CO2Select the correct data structure and algorithm to solve specific problems
CO3Implement data structures and algorithms in computer code.
CO4Analyze the performance of algorithms and data structures

Materials for Each Topic

What has been made for each topic. Materials that cover the whole module are listed on the module page.

1. What is Recursion?

↑ Back to topic 1

2. Base Cases and Recursive Cases

↑ Back to topic 2

3. The Call Stack and Recursion

↑ Back to topic 3

4. Implementing Factorial with Recursion

↑ Back to topic 4

5. Fibonacci Sequence Using Recursion

↑ Back to topic 5

6. Recursive List Traversal

↑ Back to topic 6

7. When to Use Recursion

↑ Back to topic 7