cs1321 - PowerPoint PPT Presentation

About This Presentation
Title:

cs1321

Description:

cs1321. December 6, 2001. Review. What is computer science? What's an algorithm? ... Embarrassing photo structure example. Effect of structures on template. Week 4 ... – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 21
Provided by: na32
Category:
Tags: cs1321

less

Transcript and Presenter's Notes

Title: cs1321


1
cs1321
  • December 6, 2001
  • Review

2
Week 1
What is computer science? What's an
algorithm? Processes and programs Overview of
some programming language concepts Functional vs.
imperative vs. object-oriented paradigms Compiled
vs. interpreted languages Math revisited What's
a function? What's a parameter? What's a
literal? What's an operator? Going from
mathematical functions to Scheme functionsReview
of function terminologyDefining Scheme
functions!Design Recipes
3
Definitions
4
Definitions
5
Definitions
Functions, parameters, literals, operators
6
Week 2
Fahrenheit to Celsius problemUse of
abstraction Larger example with
abstractionMovie ticket prices, revenue,
Abstraction breaking the problem
down Synthesis building a larger solution from
solved small abstracted parts Making decisions
cond statement Boolean types true,
false Boolean or logical operators and, or
not Boolean valued functions predicates Symbols
Data analysis and definitions variable pricing
on DVDs based on quantity purchased Code driven
by the data analysis
7
Key Concepts
Conditionals/Predicates (define (negative?
num) (if (lt x 0) true
false)) What character do we usually use to end
a predicate function name? (hint)
8
Week 3
Grouping data with a structure Intro of posn data
structure How to define your own
structure define-struct Functions generated for
you when you define a structure field
selectors predicate (and we see much later set
functions as well) constructor
(make-whatever) Embarrassing photo structure
example Effect of structures on template
9
Week 4
Shape data definition can be circle, square,
etc. Effect on template Self-referential data
structures our own matryoska doll
structure scheme provided list built with
cons function first and rest functions cons
cell underlying list list? empty?
cons? effect on template Recursion a function
calling itself used for repetition 1. function
calls itself 2. has terminating condition(s) 3.
moves closer to a trivial version of the
problem (moves closer to the terminating
condition) How does it work? Activation
stack! substitution model of evaluation example
factorial
10
Week 5
Given a list, build a new list increase TA
salaries example Practice with handling TA
structures Insertion sort on list insert a TA
into a list of TAs based on salary Introduction
of list function (list 1 2 3) and (1 2 3)
11
Week 6
Binary Trees family tree example know the tree
terminology!! Tree recursion Tree
traversal preorder inorder postorder Binary
Search Tree searching a BST inserting into a
BST deleting from a BST tough!
12
Week 7
Processing lists of lists Tree style
recursion Flatten function append
function Mutually referential data
structures Iterative refinement Processing two
lists simultaneously The truth about append
function
13
Week 8
Merging lists Writing good test cases cover
the possibilities! Recognizing similarities in
functions and abstracting! pass values as
parameters pass functions as parameters Scope In
troduction of local locally defined functions
14
Week 9
Map function Examples of passing functions as
parameters Effect on contract Merge sort
divide and conquer Lambda bodies Generative
recursion Billiard balls
15
Week 10
Quicksort Fractals Head recursion versus tail
recursion pros cons converting between
them
16
Week 11
Graphs BFS what data structure does it
use? DFS what data structure does it use?
17
Week 12
Breaking away from pure functional
programming let set! Iteration the do
loop Vectors Big O complexity of algorithms
18
Week 13
More Big O examples Grouping statements with
begin Persistence intro to lexical
closure adder example Coke machine example
19
Week 14
Lexical closure continued Coke machine
example Inheritance with vending machine and
coke machines, coffee machine And a taste
of Java
20
(No Transcript)
Write a Comment
User Comments (0)
About PowerShow.com