CHAPTER 4: INTRODUCTION TO RECURSION, STACKS, AND QUEUES

Presents recursion as a special case of the top-down approach to problem solving

Explains recursive programs

how to understand them

how to simulate them

how to write them

Shows how recursive programs may be translated by a compiler or written in a non-recursive language

Introduces two more data structures

the stack

the queue

Illustrates the use of a stack with operations

setstack

empty

push

pop

Case study梒hecking sequences for proper nesting

uses the stack and treats it as a data abstraction

4.1: What Is Recursion?

4.2: Using Recursion

4.3: A Close Look at the Execution of Recursive Programs

4.4: Implementing Recursive Programs

4.5: Stacks

4.6: Evaluation and Translation of Expressions

4.7: Queues

4.8: Case Study: Checking Sequences for Proper Nesting

Exercises

Suggested Assignments