Algorithm Complexity Analysis

Cards (15)

  • When selecting an algorithm, the space/time trade-off will always be in consideration, as faster run times may come at the cost of using extra memory space, vice versa.
  • Complexity Analysis is a technique to determining the complexity of a program by analyzing the program's structure.
  • Input the correct terms:
    A) Logarithmic
    B) Constant
    C) Linear
    D) Quadratic
  • An algorithm with a linear performance means that its work grows in direct proportion to the size of the problem.
  • An algorithm with a quadratic performance means that its work grows as a function to the square of the size of the problem.
  • Polynomial Time Algorithms usually occur when nested loops are used, and scale much worse with larger problem sizes as compared with Linear Time Algorithms.
  • Constant Time Algorithms would always require the same number of operations for any problem size.
  • Exponential Time Algorithms are impractical to run with large problem sizes due to how large they scale up as the problem size increases.
  • Big-O notation is used to express efficiency or computational complexity of an algorithm. It is used to talk about the long-term growth rates of functions.
  • When identifying the time complexity of an algorithm, the dominant term is usually used as when the problem size approaches infinity, that term grows so large that it can ignore the amount of work represented by the other terms.
  • Big Theta is used to indicate that an algorithm is bounded both from above and below, ergo the average time complexity of the algorithm.
  • Asymptotic analysis is a mathematical technique used to study the behavior of algorithms as the input size approaches infinity. 
  • Big Omega is used to give the lower bound of the growth of an algorithm, ergo the worst case time complexity of the algorithm.
  • O( 1 ) < O( log N ) < O( N ) < O( N log N ) < O( N^2 ) < O( 2^N ) < O( N ! )
  • The constant of proportionality involves the terms and coefficients that are usually ignored during Big-O analysis.