From the course: Get Ready for Your Coding Interview

Unlock the full course today

Join today to access over 23,100 courses taught by industry experts.

Overview of big O notation

Overview of big O notation

- [Instructor] Big O notation is a way of indicating how complex our function is and how much time it takes to run your function. It's also a convenient way to express the time complexity of a function, and it comes up a lot in a coding interview. Let's take a look at the function we saw earlier. This function adds up all the items in the given list or array. The time it takes to run this function grows linearly, or like a straight line, and it can be written as T equals AN plus B, where A and B are constants. The fact that this grows linearly or like a straight line can be represented by writing AN plus B equals big O of N. This can be also read as the time it takes to run this function T grows in the order of N. There's a simple way to find what should be inside the big O expression. You first need to find the fastest growing term in T. We have two terms in T, AN and B, and obviously AN is the faster growing term here.…

Contents