Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Time complexity

Time complexity describes how an algorithm’s running time grows with its input size. The following sections introduce calculation rules, common complexity classes, and techniques for estimating efficiency.

The maximum subarray sum problem illustrates how different algorithms for the same task can have very different running times.