﻿1
00:00:00,440 --> 00:00:06,500
‫So another way that we simplify Big O is we drop non dominance.

2
00:00:06,800 --> 00:00:12,950
‫And so to explain this, I'm going to bring up the nested for loops that we had in the last video,

3
00:00:13,400 --> 00:00:18,050
‫but I'm going to add an additional for loop after the nested for loops.

4
00:00:18,840 --> 00:00:22,770
‫So now let's flip over to VS Code and take a look at this.

5
00:00:23,580 --> 00:00:30,960
‫So there is our new print items function there with our nested for loops followed by a single for loop.

6
00:00:31,260 --> 00:00:35,790
‫And then down here, we're going to pass that, the number ten and I'll run this.

7
00:00:37,400 --> 00:00:43,790
‫So I'm going to scroll to the top and you can see that this starts with zero zero and then it goes down

8
00:00:43,790 --> 00:00:45,800
‫to nine nine.

9
00:00:46,220 --> 00:00:52,490
‫Those are created by the set of nested for loops, and then that single for loop is going to print out

10
00:00:52,490 --> 00:00:54,500
‫zero through nine.

11
00:00:55,160 --> 00:00:57,170
‫So now let's flip back.

12
00:00:57,800 --> 00:01:08,450
‫So the set of nested for loops ran o of in squared times and then that single for loop ran end times.

13
00:01:08,450 --> 00:01:18,950
‫So the total number of operations was O of n squared plus o of n or you could write it like this in

14
00:01:18,950 --> 00:01:25,400
‫squared would be the dominant term and n would be the non dominant term.

15
00:01:25,880 --> 00:01:31,760
‫So if you think about when n becomes very large, even if we use a number that is not that big, like

16
00:01:31,760 --> 00:01:40,370
‫a hundred in squared is going to be 10,000 where that standalone N is going to only be 100.

17
00:01:40,610 --> 00:01:48,590
‫So that stand alone N as the number gets larger and larger becomes less and less significant in this

18
00:01:48,590 --> 00:01:49,400
‫equation.

19
00:01:49,880 --> 00:01:56,270
‫So we simplify this by dropping the N and just keeping the N squared.

20
00:01:56,750 --> 00:01:59,540
‫So this rule of simplification is called.

21
00:02:00,360 --> 00:02:01,860
‫Dropped non dominance.

