﻿1
00:00:00,470 --> 00:00:09,290
‫So with Big O, we have a few rules for simplification and the first one of those is called drop constants.

2
00:00:09,620 --> 00:00:15,890
‫So to explain this, I'm going to start with the function that we looked at in the last video, which

3
00:00:15,890 --> 00:00:25,550
‫was O of N, except that I'm going to add a second for loop and both of these are going to run in times.

4
00:00:26,120 --> 00:00:30,320
‫So let's flip over to VS Code and take a look at this.

5
00:00:30,960 --> 00:00:37,980
‫So there is our new function with our two four loops, and then we will run this with the number ten

6
00:00:38,340 --> 00:00:45,210
‫and these two for loops have printed out zero through nine here and then zero through nine here.

7
00:00:45,600 --> 00:00:51,060
‫So we pass this function, the number ten, and it printed out 20 items.

8
00:00:51,600 --> 00:00:53,730
‫So now let's flip back.

9
00:00:54,210 --> 00:01:00,630
‫So this function ran in plus in times or two in.

10
00:01:00,990 --> 00:01:07,020
‫So you might think that we're going to write this as O of two n, but we don't.

11
00:01:07,020 --> 00:01:12,360
‫We will always drop the constant and just call it O of n.

12
00:01:12,660 --> 00:01:16,020
‫So it doesn't matter if it's two N or 100 n.

13
00:01:16,170 --> 00:01:18,600
‫We're going to drop the constant.

14
00:01:19,080 --> 00:01:22,530
‫And you might wonder, why would we do that?

15
00:01:22,830 --> 00:01:27,990
‫Isn't it different to have something run two in times versus one in time?

16
00:01:28,560 --> 00:01:36,060
‫So the thing we're trying to do with Big O is figure out the broad category that the growth rate is

17
00:01:36,060 --> 00:01:36,720
‫in.

18
00:01:36,960 --> 00:01:45,990
‫So even at 100 N, it is growing linearly and that is very different than something that is say growing

19
00:01:45,990 --> 00:01:49,950
‫exponentially as in becomes very large.

20
00:01:49,980 --> 00:01:54,990
‫That exponential growth rate is in a completely different category.

21
00:01:55,140 --> 00:01:58,470
‫So that's why we have these rules of simplification.

22
00:01:58,920 --> 00:02:05,370
‫And we'll see a couple more rules of simplification as we are going through this big O section and it

23
00:02:05,370 --> 00:02:08,730
‫actually makes big O a lot easier.

24
00:02:09,060 --> 00:02:11,850
‫But our first rule of simplification.

25
00:02:12,690 --> 00:02:14,160
‫Is drop, Constance.

