{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

lecture5

# lecture5 - D ATA A BSTRACTION G EORGE WANG...

This preview shows pages 1–3. Sign up to view the full content.

D ATA A BSTRACTION 5 G EORGE W ANG [email protected] Department of Electrical Engineering and Computer Sciences University of California, Berkeley June 28, 2010 1 Administrivia We apologize for all the corrections done for the homework. We didn’t do a good enough job beta testing the homework before we released it. We’ve learned our lesson, and we’re aiming to do a much better job for your future homeworks. 1.1 Addendum to Cheating Policy Sorry for not making this clear. I wanted you to know how the cheating policy for this course worked. Although I spoke at length about what constituted cheating and how we’re trying to prevent you from cheating, I didn’t talk about what the penalties were for cheating. If you cheat on the homework, we’ll give your first offense -4/0. After that, it’s an automatic F. If you cheat on projects or exams, it’s an automatic F. We want you to know that we are practically always available one way or another (via email if nothing else), and that if you start early, there is no reason you should need to resort to cheating. Furthermore, you are encouraged to collaborate on homework so long as you note where you are getting help. The first project, however, is an individual programming assignment, just so you know. 2 Review from Last Week We talked about the Syntax of Scheme. I’ll list all the functions you should know by today, but if you’re missing any take time to review the other lecture notes later. This is in no particular order. lambda, let, every, keep, accumulate, first, butfirst, word, bf, last, butlast, bl, word, quote, equal?, if, cond , member?, +, -, /, * , repeated, count, empty? 1

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
2.1 Runtime of an Algorithm Consider the insertion sort algorithm you did as homework. What we want to make sure we understand is the runtime of each section of it. So, let’s look at insert first. What is the runtime there? Well, whatever it is, we’ll multiply that runtime by the length of the unsorted-sent. To see why, imagine we are trying to do something that takes us 8 hours per day. Say we work for 30 days. How long have we spent? Well, for each of those 30 days, we do 8 hours of work, so we do 30 × 8 = 240 hours of work. This is the same thing. For each element of the unsorted sentence, we must do an insertion’s worth of work.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 5

lecture5 - D ATA A BSTRACTION G EORGE WANG...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online