Skip to playerSkip to main content
  • 19 minutes ago
Transcript
00:00Now, like my big O time complexity is also big O notation.
00:04Big O notation is also a term which represents one way of time complexity.
00:09In placement, in internship, no one will ask you big O not.
00:13We always ask big O not.
00:15Because we have to understand theoretically the students who are interested in exams in college.
00:21This video is specifically for them.
00:24Now, what is big O notation?
00:25Big O notation represents my lower bound.
00:28I have removed the upper bound.
00:32What is lower bound?
00:33Lower bound, i.e. best case time complexity.
00:37If my big O, how do I write O?
00:41How do I write O?
00:42If my big O time complexity is N2.
00:46Then my code can run in N3 and N4.
00:52It can run in N5.
00:53It can run in N5.
00:54But it can run in N2.
00:55And it can run in N2.
00:59It can run in N2.
01:00It can run in N2.
01:12or it will be more than it. So it has told you in the best case.
01:16You can have a minimum of that but the rest of the case
01:19or average cases will be more than it.
01:24So we have given lower bound.
01:27How can I visualize this? This is my lower bound time complexity.
01:31This is my upper bound time complexity. Lower bound tells me that
01:35my time complexity can always go up. Upper bound tells me
01:40that my time complexity can always go up.
01:45Or I will flip it.
01:48Upper bound tells me that time complexity will always go up.
01:52Lower bound tells me that time complexity will always go up.
01:55Now this is my big omega notation. We can remove this.
01:59We have some mathematical terms. We can go and read it in the book.
02:03This book is the Korman name. I will tell you again.
02:09But theoretically, you can go and read things.
02:12You have to strengthen your fundamentals.
02:16You have to strengthen your fundamentals.
02:16You have to strengthen your maths.
02:18Then you can refer it.
02:20If there is no extra time to spend,
02:22then you can practice important questions.
02:24If there is extra time, then we can invest that time.
02:29Beyond that, there is a third time complexity.
02:32One is big O.
02:33One is big omega.
02:34One is big theta.
02:36What do they say? Big theta.
02:39Now don't say this.
02:41There are four things.
02:42There are three things in big.
02:43Big O, big omega, big theta.
02:46Big O is the most important.
02:48All the placement and internships are asked.
02:50Big omega can be in your college exam.
02:53No one will ask about it.
02:54No one will ask about it.
02:55No one will ask about it.
02:56No one will ask about it.
02:56No one will ask about it.
02:56Big theta means average bound.
02:59In the cases, in the codes, in the algorithms,
03:03we will know that it is lower bound
03:05and upper bound is equal.
03:07It means worst case time complexity
03:09and best case time complexity.
03:12In that case, we can say that
03:13average time complexity is the same.
03:16Big O is the same.
03:16It means theta.
03:17In this case, I know that
03:19the code is in the worst case.
03:21And big omega of n2 is in the best case.
03:24In that case, I can say that
03:25the code of time complexity
03:27is the same as big theta of n2.
03:29That means that
03:30I call average time complexity.
03:33We call it the best time complexity
03:35and the most important is our big O.
03:38Which is my worst time complexity.
03:39There are so many things to learn.
03:42As big O is also small O.
03:47Or my small omega.
03:51Or my small theta.
03:54But this is also new
03:55in the placement internship.
03:57Basically, it means that
03:58how much time complexity
03:59you can analyze this function
04:02tightly tightly.
04:03The more tightly packed time complexity
04:07we call big O
04:09and the more loosely
04:10we will remove time complexity.
04:12We will become small.
04:14We can understand this
04:15that I know that
04:16there is a person.
04:17If I talk about a human.
04:19I can say that
04:20the human height
04:21I have to analyze the height.
04:23I think that
04:25I have to analyze the height of this person.
04:27I have to analyze the height of this person.
04:29I can say that
04:30the maximum height
04:31a one point
04:34from one millimeter to one kilometer
04:34can be small.
04:37And my human's best height
04:40I have to analyze the height on the genetics.
04:44I can say that
04:45one millimeter can be small.
04:46The human height
04:48can be small.
04:49From one millimeter
04:51so ever распaraственно.
04:53I said that I lost it, I mean I don't know, it's a big difference between 1 mm and 1
04:58km
04:59but yes, it will lie under both of them, it's true, but it's a little loose, it's a big range
05:05this is my case 1, in case 1 I had to tell a random person's height
05:09let's take a case 2, in case 2 I have to tell my study height
05:13which I have seen 2 times in a day, I am going to go outside
05:17so how do we analyze the study height?
05:19we know that the height is maximum 6 feet
05:24from 6 feet it's small, we can say it's 5 feet or 4 feet
05:31so what happened, I gave a small range, the range is small
05:36so I can say it's tightly packed, the range is tight, it means it's a little less numbers
05:42in this range there are many numbers
05:45so I can say this is my tight bound, this is my loose bound
05:49now the big O complexities are in this range
05:54it's tightly packed and the small O is loosely packed
05:58what do we do? we analyze the tightly packed
06:01we always analyze the big O
06:02because that is my tightly packed
06:06plus my worst complexity
06:09the long близ
06:09that I also have to tell a lot of
06:09that I also have to tell a whole
06:09that I have to tell a story of the
06:09that I have to tell a story about
06:09that I have to tell a story about

Recommended