CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 13: Bugs and Two Stage Recursion.

Slides:



Advertisements
Similar presentations
Homework for the week of Sept. 3rd, 2013 Monday Spelling:Spelling: Pages 7 and 8. Reading:Reading: 1 box of the IRR sheet. Use your AR book. Complete in.
Advertisements

Read the following: oo The zoo is too far from school oo The cook can cook good cookies ow The tree by the window grows slowly ow The cow is eating.
Introduction to Computer Science Robert Sedgewick and Kevin Wayne Recursive Factorial Demo pubic class Factorial {
LING 388: Language and Computers Sandiway Fong Lecture 5: 9/5.
CS107 Introduction to Computer Science Lecture 2.
_________’s M.O.N.K.E.Y. (My Organization Notebook Keeps Everything Yearlong) Binder Mrs. Myers Grade 4- Room 206 Morrison Elementary School.
What’s this course all about?
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 4: Review Conditional & Word Stuff.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 17: HOF and Tick-Tack-Toe.
QUESTION 1 What day is it today? A) I’m Tuesday. B) I have Tuesday. C) Tuesday. D) It’s Tuesday.
CS3 Fall 2005 Lecture 11: Finish higher order functions Midterm Prep.
Slide 1 CS3: Lecture 8 Advanced recursion. Slide 2 Schedule Oct 10Advanced recursion Oct 17Number-spelling Miniproject Oct 24Higher order procedures Oct.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 18: HOF.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 26: Printing and Stuff.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 14: Number Spelling Mini-project.
Slide 1. Slide 2 Administrivia Mid-semester survey this week (Thur/Fri) –you NEED to do this. Interviews should be starting in a few weeks. I apologize.
Alphabitia Read the introduction. Use the “artifacts”. UnitLong Flat.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 12: Homework stuff and Accumulating Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 19: HOF Problems.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 6: Mini-Project Prep.
CS3: Introduction to Symbolic Programming Spring 2006Nate Titterton Lecture 4: "Difference Between Dates" and data abstraction.
Slide 1 Midterm 1 Midterm 1: Feb 28 th (next week). –In the lecture slot, plus 20 minutes (4:10-5:30 pm, 120 Latimer) –Everything we’ve covered, including.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 10: Recursion Rocks Again!
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 20: Tree Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 1: Introduction & Administration.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 11: Accumulating Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 8: Recursion.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 9: Recursion Rocks!
Midterm Logistics Where? 2050 VLSB When? Monday, 4:10 to 5:40 What to do? –“Review problems” from Thursday/Friday in UCWise. –Two practice exams and solutions.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 2: Review – Writing Procedures.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 16: Let and Lambda.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 25: Trees and Generalized Lists.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 27: Review – most children and truth about cons.
Slide 1 CS3 Fall 2005 Lecture 9: Higher Order Functions.
CSSE221: Software Dev. Honors Day 18 Announcements Announcements Markov, some capsules coming back Markov, some capsules coming back Due this week: Due.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 7: Review.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 15: Procedures as Arguments.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 5: Difference Between Dates Case Study.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 24: Review for lists, map and member.
CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 3: Conditional Expressions.
August 13, 2014 Today ◦ Seating Chart ◦ Introductions ◦ Meet me ◦ Name Tags Tomorrow ◦ Finish Name Tags ◦ Appointment Clocks ◦ Syllabus ◦ Names Friday.
Test tomorrow!! Monday’s homework – review wkst + primary source readings: turn in now please!! I am at district training with Coach Moore today and tomorrow.
CS61A Lecture Colleen Lewis. Clicker Query What else are you doing this summer? A)Taking another class B)Working C)Taking another class and.
Introduction to Databases Computer Science 557 September 2007 Instructor: Joe Bockhorst University of Wisconsin - Milwaukee.
Center for the Visual & Performing Arts. $25.00(CASH/MONEY ORDER) January , 2015 Before & After School Near the Main Entrance YEARBOOK FINAL PRE-SALE!!
1 Thought for the Week: “ We can do anything we want as long as we stick to it long enough.” --Helen Keller Today- 1.Computer lab (V-115) for 1 st half.
International business ethics and csr IPW Programme by William Scarff,Senior Lecturer University of Wolverhampton Business School May 2013.
AP ENGLISH LANGUAGE AND COMPOSITION Wednesday, 2/11/15.
Today is: Wed. March 17, 2010 Please read “Changing Borders in Europe” on p. 256 in your textbooks. 1. What is story of the German-French border described?
APPLIED COMPUTER PROGRAMMING Who am I? Adriana ALBU Lecturer at Automation and Applied Informatics Department from Automation and Computers.
Math 8 – Warm-up # 3 (Friday, August 10 th ) AGENDA Check homework pg. 92 (workbook) Kente Cloth Task.
MCS 118 Fall 2013 September 23, GUSTAVUS ADOLPHUS COLLEGEgustavus.edu Announcements Quiz next Monday. If you need accommodations, see me. MCS 118,
Career Planning Research Activity 200 Points Due: 4/4/11 (Monday)
4/14/10Ecosystems and Limiting Factors#8 Entry Task: A milkweed bug population starts with only one female and one male. There’s plenty of food and everything.
What can we do in English?. Can you count in English? Count from one to ten and vice versa. Count from ten to twenty and vice versa. Can you continue.
Engineering 1020 Introduction to Programming Peter King Winter 2010.
1 10/15/04CS150 Introduction to Computer Science 1 Reading from and Writing to Files Part 2.
CSCD 303 Essential Computer Security Lecture 1 - Course Details.
B B C C D D Herald Museum Fri [80] Wed [60] Tue & Thur [40] Visitors to Herald Museum Mon [20]
CS 360 Lab 1 Professor: Krzysztof Nowak TA: Mark Boady.
Math 8 – Warm-up # 3 (Friday, August 10 th ) AGENDA Check homework pg. 92 (workbook) Kente Cloth Task.
CSCI 203: Introduction to Computer Science I
المدرسة الذكية (المقصود بالمدرسة الذكية, فلسفة وأهداف المدرسة الذكية,تجارب عربية وغربية في تطبيق المدرسة الذكية)    بحث مقدم للدكتورة: حنان سليمان عضو.
كيــف تكتـب خطـة بحـث سيئـة ؟؟
الدكتـور/ عبدالناصـر محمـد عبدالحميـد
نجاح وفشل المنشآت الصغيرة
CS 140 Lecture Notes: Introduction
No written homework this week due to testing
CS 140 Lecture Notes: Introduction
I am a student. We are students. You are a student. You are students. He is a student. She is a student. It is a student. They are students.
Presentation transcript:

CS3L: Introduction to Symbolic Programming Summer 2008Colleen Lewis Lecture 13: Bugs and Two Stage Recursion

Today Lab Tail Recursion Two-stage recursion Bugs in recursion Homework Thurs: Bowling (Hwk11) due Monday Fri: Compress (Hwk12) occurs-in? (Hwk13) due Tuesday Mon: Mini-project 2 due Thursday

Non-Tail Recursion Scratch Demo

Two Stage Recursion (define (sent-sum-acc sent sum-so-far) (if (empty? sent) sum-so-far (sent-sum-acc (bf sent) (+ (first sent) sum-so-far))))

Tail Recursion > (sent-sum-acc '(4 2 3) 0) (sent-sum-acc ‘(4 2 3) 0) (sent-sum-acc ‘(2 3) 4) (sent-sum-acc ‘(3) 6) (sent-sum-acc ‘() 9)

Tail Recursion “Technically” the monkey doesn’t have to stick around. Computers are smart and try to make things faster You don’t have to worry about this in CS3 but it is an important thing in CS (like at my job at Leapfrog)

Is there a bug? (define (no-pairs? sent) (cond ((empty? sent) #t) ((equal? (first sent) (first (bf sent))) #f) (else (no-pairs? (bf sent))))) (no-pairs? ‘(a))

Number Spelling How do you spell 40? - FORTY No “and”s necessary! (or wanted)