Great video! I really liked the explanation between both algorithms! I have a question I am not sure if it will make sense but, is there a way to calculate the uniformity of a sorted array before choosing to use binary or interpolation?
If you apply the formula then you get index=int(5/4)=1 (because decimal value is automatically discarded for int). Therefore, you will go and check at index 1 first and hence you will get the left 2 first. I hope you got it :)
What is the worst case of IS for totally random distribution, O(n)? Like I chose 10 random numbers out of say 1000 elements, sorted them and conducted a search on them?
interpolated search means you have information on how your data relates to one another. So you can't know how many steps it will take unless you know the pattern of your data.
Sir, In Binary search ,the worst case time complexity would be "log(n)", and interpolation is better than BS , then what would be its worst case time complexity? 1
It can be possible to get the element you want to search in just one step provided elements are in AP or GP or HP progression series. It should be possible to derive the pattern and hence the mathematical formula for Nth term otherwise it should not be possible to search any element in just one step (even though distribution is uniform). I hope you got your answer :)
If i find your vdo on any topic then i got sure i m going to understand this concept.
:)
Bro, you described it very well .I tried to search regarding this algorithm and i was scared by the jargon but we make it real smooth,hats off.
Thanks
Enjoyed your lecture ❤️. Thanks a lot. I will be writing my exams in 2 hours. Wish me success 🙏
This tutorial really helpful for computer science and engineering students..
😊
Very nice video and explanation thank you so much
Yrr mast padhato ho yrr sb doubt clear ho jaata h❤️❤️
Basically it all depends upon the formula..nice explanation..👍
Thanks
Great delivery and explanation, but I'd love if you got some type of writing pad for future videos. Was difficult to read. Ty tho
My handwritting is bad 😅
Dada Tum Bariya Kam Kar Rahe Ho !!!! ❤❤❤❤
Dhonnobaad 😊
Thanks, bro! Greatest explanation Ive ever heard!
Great video! I really liked the explanation between both algorithms! I have a question I am not sure if it will make sense but, is there a way to calculate the uniformity of a sorted array before choosing to use binary or interpolation?
Using sum of natural number i think
use seriese and sequence..
Grazie from Italy, really well explained :)
Glad you enjoyed it!
It will more simple. We need single formula thats it- new_idx = (target_value - A[0]) / (A[1]-A[0])
😂 and how you came up with this revolutionary formula. By this program will go in loop 😢
such an easy to understand tutorial!
Got it in on one watch 😇
Nice :)
great explanation
*nice explanation*
Thanks
love your vids. explained well
Thanks :)
Sir its like an AP series so can we use the formula an=a+(n-1)d
as u said the distance between every two consecutive numbers must be equal
Ap gives us sum of the series but here we don't want sum so, this formula is for😊
Awesome explanation Bro
What if the elements are 1,2,2,3,4,5 and i want to find the value 2 which one should it search first?
If you apply the formula then you get index=int(5/4)=1 (because decimal value is automatically discarded for int). Therefore, you will go and check at index 1 first and hence you will get the left 2 first. I hope you got it :)
@@techdose4u thank you so much sir
@@jeihenberb welcome :)
But 1 2 2 3 3 4 5 are not in AP or GP or HP then how it will get
But it doesn't work for finding number of duplicates example 1 2 2 2 2 3 calculations fails at a point it produce error
thanks so much
Welcome :)
Superb Explanation
Well explained
so if array uniformity is at its worst then interpolation is still good or should i use only binary search then ?
What is the worst case of IS for totally random distribution, O(n)? Like I chose 10 random numbers out of say 1000 elements, sorted them and conducted a search on them?
interpolated search means you have information on how your data relates to one another. So you can't know how many steps it will take unless you know the pattern of your data.
Sir, In Binary search ,the worst case time complexity would be "log(n)", and interpolation is better than BS , then what would be its worst case time complexity? 1
hats off sir!v thanks a ton!
Welcome :)
for bs you said time complexity is log n cause you assumed the list was already sorted right?
Thank you!
Welcome
Thanks a lot.
Welcome
Nice.
Thanks
@@techdose4u Welcome
if the elements were uniformly distributed... is it guaranteed that we will get the element we are searching for in just one step .. plis answer me
It can be possible to get the element you want to search in just one step provided elements are in AP or GP or HP progression series. It should be possible to derive the pattern and hence the mathematical formula for Nth term otherwise it should not be possible to search any element in just one step (even though distribution is uniform). I hope you got your answer :)
any explanation of the formula
nice
Great explanation and topic to choose , You deserve too many applause and as well appluads
#TECHDOSE
Is this less than O(n)??
O(1)
but how we came up with the formula that's what I wanted to know
nevermind found the proof in geeksforgeeks
Can't say man 😅
@@sayak Where is it?
Yoou are Awesome
Thanks :)
Sir pls tell me in Tamil or Telugu 😊
I found mistake in this
You put 27 instead of 25
In upper case minis 1
Tq
Wc
Sir please give this code in java language
His teaching is wrong while explaining the formula he says low is value at index 0 and when giving the example he says opposite of that.