﻿1
00:00:00,510 --> 00:00:08,490
‫So now we're going to look at our first big oh, which is O of NW and I start with o of N, not because

2
00:00:08,490 --> 00:00:14,340
‫it is the most efficient or the least efficient, but because I think it's the easiest one to get your

3
00:00:14,340 --> 00:00:15,210
‫head around.

4
00:00:15,690 --> 00:00:22,350
‫So to explain this, I'm going to build out a function that I'll call print items and we're going to

5
00:00:22,350 --> 00:00:24,450
‫pass it a number in.

6
00:00:24,900 --> 00:00:31,260
‫So inside of the function, we're going to have a four loop that's going to run in times.

7
00:00:31,260 --> 00:00:37,200
‫And then in the for loop we're going to output I from the for loop.

8
00:00:38,060 --> 00:00:42,440
‫So now let's flip over and take a look at this NVS code.

9
00:00:43,580 --> 00:00:50,750
‫So there is our function there and we're going to run print items in our main function down here with

10
00:00:50,750 --> 00:00:53,540
‫the number ten and I'll run this.

11
00:00:54,240 --> 00:00:58,790
‫And you can see over here, this has output zero through nine.

12
00:00:58,800 --> 00:01:05,850
‫So we pass the function, the number ten and it printed out ten items.

13
00:01:06,390 --> 00:01:08,610
‫So now let's flip back.

14
00:01:09,150 --> 00:01:13,320
‫So this means that this function is o of PN.

15
00:01:13,350 --> 00:01:20,040
‫In other words, we pass this the number in and then this ran n times.

16
00:01:20,520 --> 00:01:27,120
‫So now let's take a look at this on a graph and we'll be adding to this graph as we go through the big

17
00:01:27,120 --> 00:01:37,320
‫O section so we can compare one big O to another on the x axis on the bottom this is N, and then on

18
00:01:37,320 --> 00:01:46,100
‫the y axis, this is the number of operations o of n is always going to be a straight line.

19
00:01:46,110 --> 00:01:48,810
‫It is what is called proportional.

20
00:01:49,510 --> 00:01:51,730
‫And that is our quick overview.

21
00:01:52,440 --> 00:01:52,920
‫Of o.

22
00:01:52,920 --> 00:01:53,580
‫Of n.

