Running Time as a Function of Input Size

Learn how the running time of an algorithm is a function of the size of its input.

A toy example

Let’s look at a toy example to help distill our notion of running time. We define a function GetSum that takes an array AA and its length nn as inputs, and returns the sum of all the elements in the array.

Get hands-on with 1200+ tech skills courses.