lecture01 - Introduction to Algorithms...

Info icon This preview shows pages 1–14. Sign up to view the full content.

View Full Document Right Arrow Icon
Introduction to Algorithms 6.046J/18.401J/SMA5503 Lecture 1 Prof. Charles E. Leiserson
Image of page 1

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

View Full Document Right Arrow Icon
Day 1 Introduction to Algorithms L1.2 Welcome to Introduction to Algorithms, Fall 2001 Handouts 1. Course Information 2. Calendar 3. Registration (MIT students only) 4. References 5. Objectives and Outcomes 6. Diagnostic Survey
Image of page 2
Day 1 Introduction to Algorithms L1.3 Course information 1. Staff 2. Distance learning 3. Prerequisites 4. Lectures 5. Recitations 6. Handouts 7. Textbook (CLRS) 8. Website 9. Extra help 10.Registration (MIT only) 11.Problem sets 12.Describing algorithms 13.Grading policy 14.Collaboration policy ¾ Course information handout
Image of page 3

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

View Full Document Right Arrow Icon
Day 1 Introduction to Algorithms L1.4 Analysis of algorithms The theoretical study of computer-program performance and resource usage. What’s more important than performance? modularity correctness maintainability functionality robustness user-friendliness programmer time simplicity extensibility reliability
Image of page 4
Day 1 Introduction to Algorithms L1.5 Why study algorithms and performance? Algorithms help us to understand scalability . Performance often draws the line between what is feasible and what is impossible. Algorithmic mathematics provides a language for talking about program behavior. The lessons of program performance generalize to other computing resources. Speed is fun!
Image of page 5

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

View Full Document Right Arrow Icon
Day 1 Introduction to Algorithms L1.6 The problem of sorting Input: sequence a 1 , a 2 , …, a n of numbers. Example: Input: 8 2 4 9 3 6 Output: 2 3 4 6 8 9 Output: permutation a' 1 , a' 2 , , a' n such that a' 1 a' 2 a' n .
Image of page 6
Day 1 Introduction to Algorithms L1.7 Insertion sort I NSERTION -S ORT ( A , n ) A [1 . . n ] for j 2 to n do key A [ j ] i j – 1 while i > 0 and A [ i ] > key do A [ i+ 1] A [ i ] i i – 1 A [ i+ 1] = key “pseudocode” i j key sorted A : 1 n
Image of page 7

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

View Full Document Right Arrow Icon
Day 1 Introduction to Algorithms L1.8 Example of insertion sort 8 2 4 9 3 6
Image of page 8
Day 1 Introduction to Algorithms L1.9 Example of insertion sort 8 2 4 9 3 6
Image of page 9

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

View Full Document Right Arrow Icon
Day 1 Introduction to Algorithms L1.10 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6
Image of page 10
Day 1 Introduction to Algorithms L1.11 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6
Image of page 11

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

View Full Document Right Arrow Icon
Day 1 Introduction to Algorithms L1.12 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6
Image of page 12
Day 1 Introduction to Algorithms L1.13 Example of insertion sort 8 2 4 9 3 6 2 8 4 9 3 6 2 4 8 9 3 6
Image of page 13

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

View Full Document Right Arrow Icon
Image of page 14
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    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.

    Student Picture

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

  • Left Quote Icon

    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.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    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.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern