00:00And beyond that, I can say that my second program in the sorted area was directly out of its largest
00:05element
00:06Its time complexity was constant, we call it big o of 1
00:11Or big o of k, we convert it into 1 because we ignore constant
00:16So this is k multiplied by 1, where k is ignored, it is only 1
00:20That is why the largest or smallest is in the sorted area
00:24Its time complexity will always be constant
00:26How will this graph look? We can draw a graph for constant
00:30For constant, this is my time, this is my input size
00:36This is my time, this is my input size
00:40I can say that in this case 2, my input size was n is equal to 5, n is equal
00:47to 6
00:47I was looking at operations
00:50When n is equal to 1000, I was looking at operations
00:55I was looking at operations
00:55When this n is equal to 1 lakh
00:58Then I was looking at operations
01:01So what can I say
01:02That my graph will draw in this form
01:07So what will my graph be?
01:09My graph will be a straight line
01:11What is the straight line equation?
01:13The straight line equation
01:15Y is equal to some constant value
01:18This is not dependent upon the input size
01:20Or my x
01:21This is not dependent upon the input size
01:40This is not dependent upon the input size
01:45So what is the time complexity
02:00Or the input size
02:04This is not dependent upon the input size
02:06I will perform better
02:06And my constant time
02:08I will take more time
02:09I mean constant value is also bigger as compared to linear value
02:12But I have to analyze these small values
02:14And small input sizes
02:15I have to analyze these small values
02:17I have to analyze the time complexity
02:19Always think of the worst time
02:21Of the worst case
02:23When will the worst case
02:24When will the worst case come?
02:25When will my input size increase?
02:27In this range
02:30In this range
02:31In this range
02:31You will see
02:32This will increase here
02:33But my linear time will increase
02:36Like
02:38If I talk here
02:40If I want to analyze this point
02:42For this input size
02:43This is my big input size
02:45If I draw a line here
02:47This will be the point
02:49How much time will be in constant
02:51In constant
02:52There will be so much time
02:53In linear
02:54How much time will be in linear
02:55In linear
02:55There will be so much time
02:57So obviously
02:58If this code is running more time
03:00Then it is not more efficient
03:01If this code is running faster
03:03Then it is more efficient
03:05That is why
03:06Let's look at the worst case
03:07Worst case
03:08These are big input sizes
03:09And for them
03:10Always
03:10Always
03:11A constant time algorithm
03:14Or constant time code
03:15That performs better
03:17As compared to a linear time code
03:20We have to remember this