Methods for Evaluating
Algorithm Complexity
Time and Space Complexity
Time and Space Complexity
• Time Complexity:
• ----------------
• - Describes the amount of time an algorithm
takes to run as a function of the input size.
• - Common examples:
• - O(n): A simple loop that runs n times
• - O(n^2): A nested loop that runs n^2 times

Time_and_Space_Complexity_Methods111.pptx

  • 1.
    Methods for Evaluating AlgorithmComplexity Time and Space Complexity
  • 2.
    Time and SpaceComplexity • Time Complexity: • ---------------- • - Describes the amount of time an algorithm takes to run as a function of the input size. • - Common examples: • - O(n): A simple loop that runs n times • - O(n^2): A nested loop that runs n^2 times