Lesson 3: Time Complexity

Time complexity is defined as the amount of time taken by an algorithm to run, as a function of the length of the input. It measures the time taken to execute each statement of code in an algorithm. It is not going to examine the total execution time of an algorithm. Rather, it is going to give information about the variation (increase or decrease) in execution time when the number of operations (increase or decrease) in an algorithm. Yes, as the definition says, the amount of time taken is a function of the length of input only.

Open reading material (PDF)

FrogJmp

Count a minimal number of jumps from position X to Y.

Difficulty Level: Easy

PermMissingElem

Find the missing element in a given permutation.

Difficulty Level: Easy

TapeEquilibrium

Minimize the value |(A[0] + ... + A[P-1]) - (A[P] + ... + A[N-1])|.

Difficulty Level: Easy