Preview

CS202 Lecture Notes

Satisfactory Essays
Open Document
Open Document
302 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
CS202 Lecture Notes
Analysis of Algorithms

07/29/13

CS202 - Fundamentals of Computer Science II

1

Algorithm
• An algorithm is a set of instructions to be followed to solve a problem.
– There can be more than one solution (more than one algorithm) to solve a given problem.
– An algorithm can be implemented using different prog. languages on different platforms.

• Once we have a correct algorithm for the problem, we have to determine the efficiency of that algorithm.



How much time that algorithm requires.
How much space that algorithm requires.

• We will focus on
– How to estimate the time required for an algorithm
– How to reduce the time required

07/29/13

CS202 - Fundamentals of Computer Science II

2

Analysis of Algorithms
• How do we compare the time efficiency of two algorithms that solve the same problem?
• We should employ mathematical techniques that analyze algorithms independently of specific implementations, computers, or data.
• To analyze algorithms:
– First, we start counting the number of significant operations in a particular solution to assess its efficiency.
– Then, we will express the efficiency of algorithms using growth functions. 07/29/13

CS202 - Fundamentals of Computer Science II

3

Analysis of Algorithms
• Simple instructions (+,-,*,/,=,if,call) take 1 step
• Loops and subroutine calls are not simple operations
– They depend on size of data and the subroutine
– “sort” is not a single step operation
– Complex Operations (matrix addition, array resizing) are not single step

• We assume infinite memory
• We do not include the time required to read the input
07/29/13

CS202 - Fundamentals of Computer Science II

4

The Execution Time of Algorithms
Consecutive statements count = count + 1; sum = sum + count;

Times
1
1

Total cost = 1 + 1
 The time required for this algorithm is constant
Don’t forget: We assume that each simple operation takes one unit of time

07/29/13

You May Also Find These Documents Helpful

  • Powerful Essays

    Java exam 1 practice test

    • 6434 Words
    • 53 Pages

    A set of instructions that enable the computer to solve a problem or perform a task…

    • 6434 Words
    • 53 Pages
    Powerful Essays
  • Good Essays

    course notes

    • 376 Words
    • 2 Pages

    You are a family and community worker employed by a community-based organisation that is located in a public housing estate. You have been working with the following family for a number of months.…

    • 376 Words
    • 2 Pages
    Good Essays
  • Satisfactory Essays

    Course Notes

    • 898 Words
    • 4 Pages

    1. The transfer of tissue or an organ between two people who are not related is called?…

    • 898 Words
    • 4 Pages
    Satisfactory Essays
  • Powerful Essays

    Course Notes

    • 3951 Words
    • 16 Pages

    Who regulates railroad crossings and state rail safety in Texas? Texas Department of Transportation—Highway Department http://www.txdot.state.tx.us/about_us/administration/divisions/rail.htm…

    • 3951 Words
    • 16 Pages
    Powerful Essays
  • Satisfactory Essays

    lecture notes

    • 498 Words
    • 2 Pages

    zoonotic = is a carrier i.e. rabies. animal gets sick and passes it on. HIV started from monkeys malaria is NOT. its transmitted by a mosquito. Malaria is a vector they just pass it on. Malaria is an acute infectious disease. its a disease of the poor, because we can afford health management systems and vaccines.…

    • 498 Words
    • 2 Pages
    Satisfactory Essays
  • Satisfactory Essays

    ee 247b lecture notes

    • 302 Words
    • 6 Pages

    CTN 1/24/14 EE C247B/ME C218: Introduction to MEMS Lecture 2m: Benefits of Scaling I EE C245 – ME C218 Introduction to MEMS Design Spring 2014 Prof. Clark T.-C. Nguyen Dept. of Electrical Engineering & Computer Sciences University of California at Berkeley Berkeley, CA 94720 Lecture Module 2: Benefits of Scaling EE C245: Introduction to MEMS Design LecM 2 C. Nguyen 8/20/09 1 8/20/09 2 Lecture Outline • Reading: Senturia, Chapter 1 • Lecture Topics: Benefits of Miniaturization Examples GHz micromechanical resonators Chip-scale atomic clock Micro gas chromatograph EE C245: Introduction to MEMS Design LecM 2 C. Nguyen…

    • 302 Words
    • 6 Pages
    Satisfactory Essays
  • Good Essays

    In computer science, the analysis of algorithms is the determination of the number of resources (such as time and storage) necessary to execute them. Most algorithms are designed to work with inputs of arbitrary length. Usually the efficiency or running time of an algorithm is stated as a function relating the input length to the number of steps (time complexity) or storage locations (space complexity).…

    • 564 Words
    • 3 Pages
    Good Essays
  • Powerful Essays

    Cp202 Notes

    • 3320 Words
    • 14 Pages

    * We will examine the Lazar model described in the book User-Centered Web Development, Jonathan Lazar, Jones and Bartlett Publishers, 2001. ISBN 0-7637-1431-3…

    • 3320 Words
    • 14 Pages
    Powerful Essays
  • Satisfactory Essays

    Chapter 1 Lecture Notes

    • 1891 Words
    • 11 Pages

    Tax-planning research – “open facts”; advise the client on tax-planning opportunities before engaging in a transaction.…

    • 1891 Words
    • 11 Pages
    Satisfactory Essays
  • Good Essays

    We study complexity of finding a local minimum in the worst and the average cases. We introduce several neighborhoods and show that the corresponding. In the average case we note that standard local descent algorithm is polynomial.…

    • 688 Words
    • 3 Pages
    Good Essays
  • Good Essays

    An algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function.…

    • 409 Words
    • 2 Pages
    Good Essays
  • Good Essays

    Accessors are used to directly access an object’s field to get or retrieve it’s value…

    • 1782 Words
    • 8 Pages
    Good Essays
  • Satisfactory Essays

    Algorithm

    • 506 Words
    • 3 Pages

    An algorithm consists of a set of explicit and unambiguous finite steps which, when carried out for a given set of initial conditions, produce the corresponding output and terminate in finite time. (How to Solve it by Computer, RG Dromey, Prentice Hall UK, 1982)…

    • 506 Words
    • 3 Pages
    Satisfactory Essays
  • Good Essays

    Seminar notes

    • 893 Words
    • 4 Pages

    Each country in the world has its own set of laws on business associations. Although there are just under 200 states in the world, there are even more company laws. One country, the United States of America, has 50 company laws within its territory (one for each State in the Union) plus the law of the District of Columbia (http://www.citmedialaw.org/legal-guide/forming-corporation-district-columbia ) In addition, there is also US Federal law which affects companies on certain matters, such as securities law (i.e. the sale of stocks and shares) and corporate governance. The USA also has a Model Business Corporations Act. It is now fairly obvious that the number of company laws in the world is large and that no single course of study could hope to cover these laws in any detail. Indeed, this task will not be attempted. Instead, the course will take a comparative approach to company law. We shall survey selectively the company laws of various countries on particular issues and shall use the law of business associations in the UK as a focal point of that comparative study.…

    • 893 Words
    • 4 Pages
    Good Essays
  • Good Essays

    fgjh

    • 514 Words
    • 3 Pages

    Algorithms is the study of effective and efficient procedures of solving problems on a computer.…

    • 514 Words
    • 3 Pages
    Good Essays