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
From the course: Get Ready for Your Coding Interview
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.…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
-
-
(Locked)
Why time complexity and big O notation?1m 52s
-
(Locked)
Overview of time complexity4m 9s
-
(Locked)
Overview of big O notation5m 53s
-
(Locked)
Evaluating time complexity using big O3m 16s
-
(Locked)
Practical example of time complexity and big O2m 39s
-
(Locked)
Sample interview question #4: Big O1m 17s
-
(Locked)
Visual solution to sample question #43m 5s
-
(Locked)
Code solution to sample question #43m 51s
-
(Locked)
-
-