really nice... I´m kinda angry, because your alhorythm works really nicely, and contains less than 10 lines . My conained over fifty and still didn´t work :D ... But now it does. Truth is that sometimes you need to return not only one index, but a list of it, for there can be more than one possition with the given value. Keep up please, your vids are really educative and entertaining :)
I believe that binary search only considers the two possible questions: Is the element in the array? and if it is, what is the index of the first ocurrency of it?
Yes it will work, but it will return only the index of the first occurrence of that element in the array, as the main motive of binary search is to check whether an element is present in a given array or not... And if present, then at which index.
this channel is gold for data structures learners
Thanks for the videos. I appreciate your time and knowledge....
Best video ever could be on Binary Search !!!! Thanks a lot :)
really nice... I´m kinda angry, because your alhorythm works really nicely, and contains less than 10 lines . My conained over fifty and still didn´t work :D ... But now it does. Truth is that sometimes you need to return not only one index, but a list of it, for there can be more than one possition with the given value. Keep up please, your vids are really educative and entertaining :)
I believe that binary search only considers the two possible questions: Is the element in the array? and if it is, what is the index of the first ocurrency of it?
logic at 8:58 how thorough he is with the algorithm...ONLY HE EXPLAINED WHY WE DO THIS
Nice explanation,after watching this video I have the full idea of binary search, thank you so much
One of the best channel.and sir the way you teach is just awesome
GREAT VIDEO ON BINARY SEARCH SIR.
the last point is very benificial.
Excellent Explanation sir thanks a lot...
Excellent Series on Binary Search.....
very nice, keep it up, hope you can touch on circular buffer
Awesome tutorial!
u are a life saver!!
dude i love u srsly.
You are the best.
Great tutorial... Thanks and hope more videos .... related
What I want to return multiple results that have the same variable? In iterative binary search
Which compiler is he using ?
Great video!
please add indexed sequential search
After watching the video I realized that you don't need to put {} in if statement with one execution
Will this work when 2 duplicate elements are stored in an array?
Yes it will work, but it will return only the index of the first occurrence of that element in the array, as the main motive of binary search is to check whether an element is present in a given array or not... And if present, then at which index.
@@bhavyadesai6528 I asked this question 3 years ago.. funny.. you replied now😂😂
@@TheHarsh2318 and I saw now, so funny
i tried to compile online but it shows
$gcc -o main *.c
$main
Enter a number
the number 0 is not present in the array
Can I have the java file? I'm just a student.
I'd suggest you try to implement it on your own first :) You can obviously get the implementation from GeeksforGeeks.org afterwards.
Dude what's your name , i know codeschool , would like to know the dude behind this screen
Animesh Nayan
@@sunnyraj2289 its so sad that this channel ended after tragic death of lord harshal
couldn't we just do (low/2+high/2) instead of low + (high-low)/2 ?
(3/2 + 7/2) would give (1+3)=4.
3+ (7-3)/2 would give 5.
So this would give wrong result when both low and high are odd.
we can just right shift.
if low 0 you cant divide by zero