Cs1321 December 6, 2001 Review. What is computer science? What's an algorithm? Processes and programs Overview of some programming language concepts Functional.

Slides:



Advertisements
Similar presentations
Higher-Order Functions and Loops c. Kathi Fisler,
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
Functional Programming. Pure Functional Programming Computation is largely performed by applying functions to values. The value of an expression depends.
Recursion vs. Iteration The original Lisp language was truly a functional language: –Everything was expressed as functions –No local variables –No iteration.
Lambda Calculus and Lisp PZ03J. Lambda Calculus The lambda calculus is a model for functional programming like Turing machines are models for imperative.
Chapter 3 Functional Programming. Outline Introduction to functional programming Scheme: an untyped functional programming language.
CS 355 – PROGRAMMING LANGUAGES Dr. X. Apply-to-all A functional form that takes a single function as a parameter and yields a list of values obtained.
Main Index Contents 11 Main Index Contents Week 10 – Recursive Algorithms.
Factorial Recursion stack Binary Search Towers of Hanoi
CS 171: Introduction to Computer Science II
Review. What to know You are responsible for all material covered in lecture, the readings, or the programming assignments There will also be some questions.
Overview CS113, Fall 2000 Gene Itkis. The Promise Heavy Fast-paced Challenging Rewarding.
CS 101 Course Summary December 5, Big Ideas Abstraction Problem solving Fundamentals of programming.
Environments and Evaluation
CS 206 Introduction to Computer Science II 04 / 29 / 2009 Instructor: Michael Eckmann.
Unit 11a 1 Unit 11: Data Structures & Complexity H We discuss in this unit Graphs and trees Binary search trees Hashing functions Recursive sorting: quicksort,
CS 206 Introduction to Computer Science II 12 / 10 / 2008 Instructor: Michael Eckmann.
ISBN Chapter 15 Functional Programming Languages.
UNIVERSITY OF SOUTH CAROLINA Department of Computer Science and Engineering Introduction to Functional Programming Notes for CSCE 190 Based on Sebesta,
Comp 205: Comparative Programming Languages Imperative Programming Languages Functional Programming Languages Semantics Other Paradigms Lecture notes,
Recursion Chapter 7. Chapter 7: Recursion2 Chapter Objectives To understand how to think recursively To learn how to trace a recursive method To learn.
ISBN Chapter 15 Functional Programming Languages.
A Review of Recursion Dr. Jicheng Fu Department of Computer Science University of Central Oklahoma.
Recursion Bryce Boe 2013/11/18 CS24, Fall Outline Wednesday Recap Lab 7 Iterative Solution Recursion Binary Tree Traversals Lab 7 Recursive Solution.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 122 – Data Structures Custom Templatized Data Structures.
Recursion, Complexity, and Searching and Sorting By Andrew Zeng.
CS 3610 Midterm Review.
Midterm Review CSE 2011 Winter October 2015.
Chapter 12 Recursion, Complexity, and Searching and Sorting
Recursion Chapter 11. The Basics of Recursion: Outline Introduction to Recursion How Recursion Works Recursion versus Iteration Recursive Methods That.
Nirmalya Roy School of Electrical Engineering and Computer Science Washington State University Cpt S 223 – Advanced Data Structures Course Review Midterm.
ISBN Chapter 15 Functional Programming Languages.
Recursion: Linear and Tree Recursive Processes and Iteration CMSC Introduction to Computer Programming October 7, 2002.
Introduction to Scheme Lectures on The Scheme Programming Language, 2 nd Ed. R. Kent Dybvig.
Interpretation Environments and Evaluation. CS 354 Spring Translation Stages Lexical analysis (scanning) Parsing –Recognizing –Building parse tree.
Review for Final Andy Wang Data Structures, Algorithms, and Generic Programming.
Chapter Fifteen: Functional Programming Languages Lesson 12.
CompSci 102 Discrete Math for Computer Science April 17, 2012 Prof. Rodger.
Final Exam Review CS Total Points – 60 Points Writing Programs – 50 Points Tracing Algorithms, determining results, and drawing pictures – 50.
Languages and Compilers
8-1 Compilers Compiler A program that translates a high-level language program into machine code High-level languages provide a richer set of instructions.
CS 152: Programming Language Paradigms March 12 Class Meeting Department of Computer Science San Jose State University Spring 2014 Instructor: Ron Mak.
Looking inside classes Conditional Statements Week 4.
CS CS1321: Introduction to Programming Georgia Institute of Technology College of Computing Lecture 13 October 4, 2001 Fall Semester.
1 FP Foundations, Scheme In Text: Chapter Chapter 14: FP Foundations, Scheme Mathematical Functions Def: A mathematical function is a mapping of.
Final Exam Review CS Total Points – 20 Points Writing Programs – 65 Points Tracing Algorithms, determining results, and drawing pictures – 50.
CMPSC 16 Problem Solving with Computers I Spring 2014 Instructor: Tevfik Bultan Lecture 6: Stepwise refinement revisited, Midterm review.
서울대한양대 ( 안 산 ) 충남대 1년1년 컴퓨터기초 (C) 컴퓨터프로그래밍 (C, Java) 컴퓨터프로그래밍 (C) 2. 봄 프로그래밍 원리 (Scheme, ML) Structure & Interpretation of Computer Programs 프로그래밍 방법론.
CS314 – Section 5 Recitation 9
CMSC201 Computer Science I for Majors Lecture 19 – Recursion
Final Exam Review CS 3358.
CS314 – Section 5 Recitation 10
History of Computing – Lisp
Introduction to Computers Computer Generations
RECURSION.
CS 550 Programming Languages Jeremy Johnson
The interpreter.
CS 1321.
CS 270 Math Foundations of CS Jeremy Johnson
Important Concepts from Clojure
Important Concepts from Clojure
Lecture 15: Tables and OOP
FP Foundations, Scheme In Text: Chapter 14.
EE 312 Software Design and Implementation I
Functional Programming Languages
Let's Play "What's the Question"
Chapter 15 Functional Programming 6/1/2019.
EE 312 Software Design and Implementation I
Functional Programming Languages
Presentation transcript:

cs1321 December 6, 2001 Review

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 functions Review of function terminology Defining Scheme functions! Design Recipes Week 1

Definitions

Definitions

Definitions Functions, parameters, literals, operators

Week 2 Fahrenheit to Celsius problem Use of abstraction Larger example with abstraction: Movie 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

Key Concepts Conditionals/Predicates (define (negative? num) (if (< x 0) true false)) What character do we usually use to end a predicate function name? (hint)

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

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

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)

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!

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

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 Introduction of local locally defined functions

Week 9 Map function Examples of passing functions as parameters Effect on contract Merge sort – divide and conquer Lambda bodies Generative recursion Billiard balls

Week 10 Quicksort Fractals Head recursion versus tail recursion pros cons converting between them

Week 11 Graphs BFS what data structure does it use? DFS what data structure does it use?

Week 12 Breaking away from pure functional programming: let set! Iteration – the do loop Vectors Big O – complexity of algorithms

Week 13 More Big O examples Grouping statements with begin Persistence – intro to lexical closure adder example Coke machine example

Week 14 Lexical closure continued Coke machine example Inheritance with vending machine and coke machines, coffee machine And a taste of Java…