Functional Problem Solving (CSC 151 2015S) : EBoards

CSC151.02 2015S, Class 24: Recursion Basics


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support (Afternoon Section)

Other Good Things

Questions

When will we get homework back?

Next Sunday, if all goes well.

Will you send us an answer key for HW6 because we are sleeping for our health instead of doing the homework for our brain?

Yes. I'll shoot for Sunday.

Will we get our quiz back tomorrow?

I hope so?

Background

Six or seven basic components to an algorithm

Repetition

If we restrict ourselves to lists, we don't always want another list of the same size.

The idea of recursion

A common problem solving topic: Decompose a big problem into simpler problems and combine those solutions.

Recursion: Take a large problem and solve a smaller version of the problem.

Some sample recursive procedures

Counting items in a bag:

Find the heaviest thing in the bag

To find all the red items in the bag

Expressing recursion in Scheme

Contrast recursion and iteration

Start Lab

We will continue lab next class.