‫In this course, we're going to spend a lot of time on big.
‫Oh, it is a huge topic when it comes to data structures and algorithms.
‫So what is Bigo?
‫O is a way of comparing two sets of code and let's say code one and code to accomplish exactly the same
‫thing.
‫How would you compare one against the other?
‫Code one might be more readable.
‫That might be better.
‫CO two might be more concise.
‫The code might take up fewer lines, and if that's what you're measuring, then you would say that code
‫two is better.
‫Big O is a way of comparing code one and code two mathematically about how efficient they run.
‫In a coding interview, you will absolutely be asked questions about Big O.
‫So let's look at what Big O is.
‫Let's say we have a stopwatch.
‫And we run code one, we start the stopwatch and it runs for 15 seconds.
‫And we reset the stopwatch and we run code two.
‫And code two runs a lot longer than 15 seconds.
‫It runs for a full minute.
‫Based on this, you would say that code one is better than code two.
‫You can measure it.
‫This is called time complexity.
‫The thing about time complexity that is interesting is that it is not measured in time.
‫Because if you took the same code and ran it on a computer that runs twice as fast, it would complete
‫twice as fast.
‫It doesn't make the code any better.
‫It just means the computer is better.
‫So it is measured in the number of operations that it takes to complete something.
‫And we'll look at examples of that as we go along here.
‫In addition to time complexity, we measure space complexity.
‫So let's say that code one.
‫While it runs very fast comparatively, let's say it takes up a lot of memory when it runs.
‫And maybe code too, even though that takes much longer to finish.
‫Maybe it takes up less memory.
‫If preserving memory space is your most important priority and you don't mind having some extra time
‫complexity.
‫Maybe CO two is better.
‫So when you get into an interview, there's a good chance that you'll be asked questions about time,
‫complexity, and then they'll say, Hey, well, what if space complexity is our main priority?
‫How would you approach it?
‫Then you have to understand both concepts and be able to address that in the job interview.
‫But for the most part in this class, we will be dealing.
‫With time complexity.
‫And that is our quick intro.
‫Big O.