00:00Now let's talk about some common complexities that exist in our codes.
00:04Most of the complexities that we see in codes will be in this range.
00:09It may be that 3-4 are different from them.
00:11But beyond that, you can see a different time complexity today.
00:16This is usually not so much in classical algorithms.
00:19Yes, if we solve a new problem, a new program,
00:22an interviewer has given us a very beautiful problem,
00:26then the time complexity can be different.
00:28In this range, we see in this range.
00:32The first common time complexity is constant time,
00:35or big O.
00:37That is on a single straight line graph.
00:40Another common time complexity is log in.
00:43Log in graph goes like this.
00:45You can see log in time complexity is worse than constant time.
00:50Yes, log in time complexity is better when we look for big input sizes.
00:54But constant time will always be worse than big input size.
00:58It can be that for small input size,
01:00the time complexity is worse than log in.
01:04But for big input size constant time will always perform better as compared to my log in.
01:09The third common is my big O.
01:12This is linear time complexity.
01:14This is a straight line.
01:15And log in always performs better as linear in large sizes.
01:18The fourth common is my n2.
01:21The graph will become linear in some way.
01:24So linear time complexity is better as compared to n2 for big input sizes.
01:31And after that, I will put my n3 here.
01:35And here I will put my n to the power 4 here.
01:38And after that, I will put my 2 to the power n.
01:41What do we call this?
01:42We call this exponential time complexity.
01:46Why do we call this exponential time complexity?
01:47Because what is the exponent of 2?
01:49My input size is my 2 exponent.
01:53Exponential time complexity is a very bad time complexity.
01:56And this program will be run for small input sizes.
02:00We will not run for big input sizes.
02:04That's why it is a very bad thing.
02:06And we should not write such codes in real interviews and real placements.
02:11Now I will tell you a special thing.
02:13The special thing is that the most of the codes that we have written for recursion
02:17or we will write in the backtracking chapter.
02:20They will be big of 2 to the power n.
02:23If we are in the backtracking chapter or we will give exponential time complexity.
02:27So recursion gives exponential time complexity in many cases.
02:31But it is not afraid.
02:32It means that we don't think that we can write such inefficient codes.
02:35We will not write in interviews.
02:36We will not use them in placement.
02:38Why are we writing?
02:40For logic building.
02:41Because today we have written inefficient codes.
02:43Then we have learned about time complexity.
02:46Now we know that our code is not running efficiently.
02:49So what will we do?
02:50We will optimize that code.
02:51How will we optimize?
02:53How will we optimize?
02:54Using algorithms.
02:55So in recursion we also use a memoization technique.
02:59We will learn in the name of dynamic programming.
03:02In which recursion time complexity,
03:04many examples, many questions, reduce.
03:09It is reduced.
03:10It is reduced.
03:10It is reduced.
03:11It is reduced.
03:11It is reduced.
03:13It is reduced.
03:14It is reduced.
03:15It is reduced.
03:16It is reduced.
03:16It is reduced.
03:16It is reduced.
03:16It is reduced.
03:17So in exponential,
03:18we write a lot of recursion codes.
03:20But exponential time complexity is one of the worst time complexity.
03:23And we have to do this.
03:24And we have to do this.
03:25And we have to do this.
03:25In actual coding contest or actual interview.
03:27We have to do this.
03:30In most cases.
03:31There are two questions.
03:32In which you tell us that the input size is very small.
03:35Were to use recursion.
03:36So we should understand it.
03:37In which we have a small input size.
03:39In which we should understand how much input size is.
03:41Where we should have a major chance to get exponential.
03:45And we need to use recursion in any way.
03:48So in this way our input size.
03:50In this way there is a maximum length of the area..
03:54How
03:54you can use maximum length of the area. It
03:56is more than you can use. How
03:57you can use characters. The
03:59points of time complexity. I
04:02should keep putting it in a range.
04:04and how to capture such programs, such hints and how to solve these problems.
04:09We will talk about the last video of Time Complexity.