1 / 5

Lecture 14

Lecture 14. Go over midterm results Algorithms Efficiency More on prime numbers. Solutions to Midterm Exam. Question 1 Question 2 Question 3 Question 4. Algorithms. An algorithm is a specified set of steps for solving a prescribed problem.

fmiller
Download Presentation

Lecture 14

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 14 • Go over midterm results • Algorithms • Efficiency • More on prime numbers

  2. Solutions to Midterm Exam • Question 1 • Question 2 • Question 3 • Question 4

  3. Algorithms • An algorithm is a specified set of steps for solving a prescribed problem. • It does not have to be written in any particular formal language, but it has to be intelligible to a reader and completely unambiguous. • It usually has input and always has output. • It must terminate in finite time, for all possible input.

  4. Implementation of an Algorithm • An implementation of an algorithm means a computer program written in a well defined programming language to carry out the steps of the algorithm.

  5. Problem: compute the first n prime numbers. • In question 1 you implemented a simple algorithm • Let’s discuss possible improvements to make it more efficient • In particular, do we need the loop in isPrime to run up to n?

More Related