Hey, guys, what's up?
So in the last video, we learned what is a linear search.
So in this video, we will learn what is the problem with the linear search.
So the problem is very straightforward.
So what was the time complexity when I should say.
How many number of steps?
Leanness stake.
So it takes any number of steps to find the key in an area.
Okay.
So if you have an unsorted eddy, it is taking any steps to find the key.
If you have a certain area, then also it is digging and steps to find the key.
Why?
Because linear.
So it just perform a linear scan of the eddy.
So leanness search.
Just perform a linear scan over the area.
It is not using the property that the given array is sorted or the given area is unsorted.
OK, so if the given it is sorted, then I want that my time complexity should be log and number of
steps should be long.
And so this is my requirement.
Okay.
So the problem with Línea, so it is that it is not taking into consideration that whether the given
area is unsorted or whether the given area is sorted, it will just take any steps.
It doesn't matter whether they're given that is sorted or not sorted.
OK.
But my requirement is if they're given that it is sorted.
I have warned that my finding the search operation should be done in Lovgren steps.
OK.
So this is my requirement that if the given area sorted, I want searching operation and Logan steps.
So this is the requirement.
Okay.
Lena.
So it can not search in log in time.
It will do a linear scan as it requires and steps.
So for Logan Steps, we have something called Binary Search.
OK, so binary search.
Well, Search and Logan Steps.
And next, we do we will talk about how binary search searches for a given value and Logan steps.
Okay, so this is it for this video.
Thank you.