Design and Analysis of Algorithms: The Role of Algorithms *

Introduction

Syllabus: Logistics, grading, exams, homeworks, cheating.

We will study algorithms.

What's an algorithm? A carefully written recipe.
We need to agree what steps are allowed in a recipe.
We need to agree what problem the recipe is solving, ahead of time.

Important considerations

Things to keep in mind about algorithms (when analyzing and/or designing them):

Termination

On any legal (meaning, consistent with algorithm specification) input, the procedure you are describing should always eventually stop, or terminate. (In this course we will not talk about algorithms that are intended to run "forever," such as the scheduler in an operating system.)

Correctness

On any legal input, provided the procedure has terminated, the result that it produces has to be correct. Not sometimes correct, not mostly correct, but always correct.

Performance

You can measure performance in many different ways. The course will focus on the running time, but there are many others:

So in short, when you describe a recipe for doing something, make sure it always stops, make sure it always produces correct answers, and only after that worry about how efficient it is. (Depending on the algorithm, some or all of these are very easy, and some may not be obvious at all. We will see examples later.)

* Based on Prof. Boris Aronov's lecture notes.
** Material drawn from Khan Academy and https://en.wikipedia.org/wiki/Big_O_notation.