Skip to main content

Time Complexity

Learn Time Complexity (Complexity, Programming Fundamentals) with worked examples, diagrams and interview questions. Free on JavaSchoolLab.

What is Time Complexity? Time complexity measures how the number of operations an algorithm performs grows as the input size n grows . It is not measured in seconds (that depends on the CPU, JVM warm-up, and system load) — instead it counts basic operations : comparisons, assignments, arithmetic, and array/collection accesses. We express time complexity using Big-O, Big-Omega, or Big-Theta notation depending on which bound we care about.

More lessons in Complexity