Time_and_Space_Complexity_Methods111.pptx

KamranKiyani 0 views 2 slides Oct 10, 2025
Slide 1
Slide 1 of 2
Slide 1
1
Slide 2
2

About This Presentation

Time_and_Space_Complexity_Methods111.


Slide Content

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 Space Complexity: ----------------- - Describes the amount of memory an algorithm uses as a function of the input size. - Space complexity can also be evaluated using Big O notation. - Example: For an algorithm that creates a list of size n, space complexity is O(n).
Tags