Functional Problem Solving (CSC 151 2015S) : EBoards

CSC151.01 2015S, Class 48: An Introduction to Sorting


Overview

Preliminaries

Admin

Upcoming Work

Extra Credit Opportunities

Academic

Peer Support (Morning Section)

Miscellaneous

None at the moment.

Other Good Things (no extra credit)

None at the moment.

Notes on the Exam

Notes on the Project

Questions

The problem of sorting

Writing sorting algorithms

Examples: Insertion, selection, etc

Three sorting algoritms

Key operations

Improving

Formalizing the problem

    ;;; Procedure:
    ;;;   sort
    ;;; Parameters:
    ;;;   vec, vector
    ;;;   may-precede?, a binary predicate
    ;;;   get-key, a unary operation
    ;;; Purpose:
    ;;;   Create a new vector that contains the values in vec,
    ;;;   in order from smallest to largest.
    ;;; Produces:
    ;;;   sorted, a vector
    ;;; Postconditions:
    ;;;   See the preconditions for binary search.  The vector
    ;;;   should meet those preconditions.