Lesson 5 Notes

# Lesson 5 Notes - Intro to Computer Science Lesson 05 Notes...

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

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

View Full Document
haven't yet explained what an algorithm is. But you've actually written many of them already. So an algorithm is a procedure that always finishes. A procedure is just a well-defined sequence of steps. It has to be defined precisely enough that it could be executed mechanically. So to be a procedure, it has to be something that can be executed without any thought. And we're mostly interested in procedures that can be executed by computers. But the important part of what makes it a procedure is that the steps are very precisely defined and don't require any thought to execute. To be an algorithm, it has to always finish, and we've pointed out already that this is a very tough problem to figure out whether a program will finish. In general, it's not possible to answer that question, but for many specific programs it is, and in order for a program to be an algorithm, we have to know that it always finishes, and it always produces a correct result. So once we have an algorithm, well, we know we have a well-defined sequence of steps, so we can reason about what will happen on any in always produce the correct result. So, then we can think a algorithm on some input. So how should we think about c cost is quite different from how most people think about about cost, well, if you've got a specific object, let's say, y car. It doesn't quite look like a cool car, and it's got a cost \$25,000 car, and you have some other car. So you have on costs you get that car. You could another car that would b
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern