Functional Problem Solving (CSC 151 2016S) : EBoards

CSC151.02 2016S, Class 50: An Introduction to Sorting


Overview

Preliminaries

Admin

Reminders

Upcoming Work:

Extra Credit

Academic / Artistic

Peer

Regular Peer

Misc

Questions

Will the representative values be in the names of the images?

Yes,

I can't create the tar/zip file. What do I do?

Just attach all of the files to the message.

How much documentation for the helpers?

4Ps would be nice.

What if I've written 26 nearly-identical procedures?

You can write ;;; "See above"

If it's not important what the procedure returns, because, say, we've called a GIMP procedure, what should we do?

    ;;; Produces:
    ;;;   [Nothing of import]

How should we deal with the images we are copying and pasting?

Put them in a folder on your desktop. Email me the name of that folder and a note that "Sam, I give you permission to make that folder accessible." I'll fix things.

Do we have to document internal helper procedures from a named let or letrec or whatever?

No, but one line is often nice.

Document?

Yes. In ways that you think are clear.

The problem of sorting

Given a collection of values, put them in order.

As computer scientists, we want to think about

Designing a sorting algorithm

Think about writing a sort procedure in Scheme. What inputs would you have? What outputs would you have?

Group 1

Group 2

Notes

Writing sorting algorithms

We are going to sort 8 of you alphabetically by name. We already know how to compare things alphabetically. How do we get these eight people in order?

Strategy 1: TCNC Sort (aka Bubble Sort)

Strategy 2: EHRB Sort

Will it work? It looks like it. Will it be faster? It's hard to tell.

Strategy 3: Selection Sort

Strategy 4: TFATP Sort

Formalizing the problem