Preview

Computer Science Algorithm Analysis Final Study Guide

Better Essays
Open Document
Open Document
1429 Words
Grammar
Grammar
Plagiarism
Plagiarism
Writing
Writing
Score
Score
Computer Science Algorithm Analysis Final Study Guide
Asymptotic Functions:

Big-O notation: The formal method of expressing the upper bound of an algorithm’s running time (worst case) Big-Omega notation: The formal method of expressing the lower bound of an algorithm’s running time (best case) Theta Notation: The method of expressing that a given function is bounded from both top to bottom by the same function This exists if and only if f(n) is O(g(n)) and f(n) is Ω(g(n)) Little-O notation: f(n) is little-O(g(n))--denoted o(g(n))--if and only if f(n) = O(g(n)), but f(n) ¹ Q(g(n)) Little-Omega notation: f(n) is little-omega(g(n))—denoted w(g(n))—if and only if f(n)=Ω(g(n)), but f(n) ¹ Q(g(n))

Big-Oh:

http://www.youtube.com/watch?v=foUNGAsN-1M&feature=related Formal definition (symbols): f(n) = O(g(n)) if $ c, n0 | f(n) <= c * f(n) when n >= n0. Formal definition (words): f(n) = O(g(n)) if a real positive numbers c and a positive integer N exist such that f(n) <= c * g(n) for all n >= N. That is, c * g(n) is an upper bound on f(n) when n is sufficiently large. Reduction steps:

For the example code: Cost:

1) int sum(int n) {

2) int sum; 0

3) sum = 0; 1

4) for(int i = 1; i <= n.length; n++) 2n + 2

5) sum += i * i * i; 4n

6) return sum; + 1

Add up the total cost of the function = 6n + 4

c. Reduce all constants to 1 = 1n + 1

- Highest power will be Big-Oh

d. Apply O(f(n)) definition

- Ex) Let c = 6+1 = 7

Is 6n

You May Also Find These Documents Helpful

  • Satisfactory Essays

    Consequently, if the advantage of A against the proposed scheme is ϵ, the success probability of the algorithm C against the DDH challenge is at least ϵ/(e(m!q_T+1)).…

    • 111 Words
    • 1 Page
    Satisfactory Essays
  • Good Essays

    It is a mathematical expression in which a number is expressed as N x 10^n where N contains only one nonzero digit to the left of the decimal and n is an integer.…

    • 425 Words
    • 2 Pages
    Good Essays
  • Good Essays

    The reason for this question is to figure out the operation and the example is O(3n). in addition, the variable of the three operation is to calculate X(X+3)+2 with one more from X+3 then multiply X(X+3)+2. Thus, N is such as X for X goes to 1 to N. furthermore, now the total number of the operation has come to O(3n). in conclusion, O(3n) describe the many example of complexity of algorithm in the number of terms of the operation that run in this program.…

    • 2006 Words
    • 7 Pages
    Good Essays
  • Powerful Essays

    Java Chapter 2 Quiz

    • 2047 Words
    • 9 Pages

    6. A(n) ____ is a value that is written into the code of a program.…

    • 2047 Words
    • 9 Pages
    Powerful Essays
  • Satisfactory Essays

    LYT2 Task2

    • 4061 Words
    • 12 Pages

    Stein, S. S., Gerding, E. H., Rogers, A. C., Larson, K. K., & Jennings, N. R. (2011). Algorithms…

    • 4061 Words
    • 12 Pages
    Satisfactory Essays
  • Satisfactory Essays

    Maths Order of Operation

    • 291 Words
    • 2 Pages

    In mathematics , the order of operation also known as precedence rule is a rule used to clarify which procedures should be performed first in a given mathematical expression. When there is more than one operation involved in a mathematical problem, it must be solved by using the correct order of operations.…

    • 291 Words
    • 2 Pages
    Satisfactory Essays
  • Good Essays

    Most likely time estimate is an estimate of the maximum time an activity will require.…

    • 6920 Words
    • 28 Pages
    Good Essays
  • Powerful Essays

    Calculus Lab Report

    • 3000 Words
    • 12 Pages

    Let's say that the function that we're interested in is , and that we're interested in its limit as approaches . Using the above notation, we can write the limit that we're interested in as follows:…

    • 3000 Words
    • 12 Pages
    Powerful Essays
  • Good Essays

    C++ Midterm

    • 2831 Words
    • 12 Pages

    What is the value inside the "value" variable at the end of the given code snippet?…

    • 2831 Words
    • 12 Pages
    Good Essays
  • Satisfactory Essays

    Just as punctuation marks are used to make sentences, the order of operations are used to make math sense. Whenever the order of operation is not indicated by grouping symbols, there is a standard order of operations to be followed. That order is Exponents, Multiplication, Division, Addition and Subtraction from left to right. In mathematics, more than in some other forms of written expression, ambiguity must be eliminated. Otherwise, different people may assign different meanings to the same symbols, and communication is faulty. Ambiguity is eliminated using grouping symbols and the order of operations…

    • 276 Words
    • 2 Pages
    Satisfactory Essays
  • Powerful Essays

    * Operational Definition: This means that terms must be defined by the steps or operations used to measure them. Such a procedure is necessary to eliminate any confusion in meaning and communication. Stating an operational definition forces one to identify the empirical referents, or terms. In this manner, ambiguity is minimised.…

    • 1017 Words
    • 5 Pages
    Powerful Essays
  • Good Essays

    How to Make Cue Cards

    • 833 Words
    • 4 Pages

    have approximate timings marked so you can track yourself through your allotted time. If you find you're going over you can adjust by leaving out an extra example or conversely if you're under time, you can add one in.…

    • 833 Words
    • 4 Pages
    Good Essays
  • Powerful Essays

    Software Metrics

    • 1537 Words
    • 7 Pages

    Software metric is a measure of some property of a piece of software or its specifications. Since quantitative measurements are essential in all sciences, there is a continuous effort by computer science practitioners and theoreticians to bring similar approaches to software development. The goal is obtaining objective, reproducible and quantifiable measurements, which may have numerous valuable applications in schedule and budget planning, cost estimation, quality assurance testing, software debugging, software performance optimization, and optimal personnel task assignments.…

    • 1537 Words
    • 7 Pages
    Powerful Essays
  • Powerful Essays

    conclusion that reducing the Order Lead Time until it is less than Tall, the allowable…

    • 19143 Words
    • 77 Pages
    Powerful Essays
  • Good Essays

    Smude

    • 2040 Words
    • 9 Pages

    Where cj, bi and aij (i = 1, 2, 3, ….. m, j = 1, 2, 3…….. n) are constants determined from the technology of the problem and xj (j = 1, 2, 3 n) are the decision variables. Here ~ is either < (less than), > (greater than) or = (equal). Note that, in terms of the above formulation the coefficient cj, aij, bj are interpreted physically as follows. If bi is the available amount of resources i, where aij is the amount of resource i, that must be allocated to each unit of activity j, the “worth” per unit of…

    • 2040 Words
    • 9 Pages
    Good Essays