COSC 350: Data Structures
March 16, 2009


Deques, Generalized Queues

Stack and Queue Applications

Prefix, Infix, and Postfix expressions

When to use each:
Stacks—Naturally reversing
Queues—Naturally in order

Other ADT

Complex Numbers

Starting Recursion

Definition of Recursion:
A function that calls itself

Rules of (Terminating) Recursion:
1. Must have a terminating base case
2. Must test for base case before recursive call
3. Recursive call must move toward base case

Recursive Definitions from Mathematics

Factorial
Fibonacci numbers

Homework

1. Write a recursive program to count the number of items in a list. E.g., count([1,2,3,4,5,6]) -> 6
2. Write a recursive program that add the even numbers in a list of numbers. E.g., even([1,2,3,4,5]) -> 6


This page was created by Joe Sloan.
It was last modified on or after: 18 March 2009
Send mail to: sloanjd@wofford.edu