What is binary search

preview_player
Показать описание
See complete series on binary search here
Binary search is one of the most fundamental algorithms in computer science. In this lesson, we have tried to explain binary search
Prerequisite: basic programming skill, knowledge of concepts like array and loop..

For more such videos and courses, subscribe to our YouTube channel.

You may also like us on facebook:
Рекомендации по теме
Комментарии
Автор

Indians are very intelligent people, Thanks, Greetings from Nigeria.

GistTech
Автор

This guy is the best teacher, i watched a lot of teaching videos but this one is really the best

sherumov
Автор

Although in programming, in most cases we mean recursion as an implementation where a function calls itself,  recursion as a process is reducing a problem to sub-problem in a self-similar manner. Any program that can be written using recursion can be written iteratively as well. In fact, if you write a recursion for binary search, it will be called a tail recursion which will anyway be optimized by compiler to iteration. Thanks for asking :)

animeshnayan
Автор

Very clearly presented, thanks for taking the time to make these great tutorials!

MrVee
Автор

I am not from computer science background. So i have no idea about Big o(n) complexity. Finally I found your tutorial here. It really helpful. I finally followed your instruction and applied this logic in my application which i am working. It works like charm :)

//Node js version
function search (arr, x){
var start = 0;
var end = arr.length - 1;

console.log("Start value:", start);
console.log("End value:", end);
console.log("search for x:", x);
while( start <= end){

var mid = Math.floor((start + end) / 2);

console.log("Middled value:", mid);
if(arr[mid] === x){
//console.log("element found:", arr[mid], mid);
return mid;
}else if(x < arr[mid]){
end = mid - 1;
console.log("x is lessethan arr[mid]:", end);
}else{
start = mid + 1;
console.log("else:", start);
}
}
return -1;
}


console.log("element found in the list:", search(searchArray, 4999));

Thank you much bro!

sajankumar-xkvj
Автор

Please do a full featured course on Data Structures and Algorithms and solve around 100+ very popular competitive problems and upload it on Udemy! We will be happy to buy it

zaidtergaon
Автор

I would rate this 10/10. You have a weird accent but everything is clear, and the diagrams are also on point. Keep up the good work man. :)

Sameer
Автор

Thank you so much for the clear explanation! My PH.D professor needs to learn from you on the art of teaching.

pomeraniansandacat
Автор

Thanks for helping me get through cs50! I honestly would have given up if it wasn't for your videos

nishkamkhanna
Автор

thank you very much for this tutorial.
watching it few hours before exams 😂

victorultimate
Автор

This guy is awesome, very clear explaination

wuzongye
Автор

Amazing explanation, clear and to the point.

shaunakphatak
Автор

Video starts at 4:25, before that is super basic information not regarding binary search,

jessneurismfarmer
Автор

Superb Explanation. Even after 9yrs I feel this one of the best explanation...

digambaringale
Автор

Thanks for the awesome explanation! I watch your videos to gain conceptual clarity.

venkat
Автор

finally i started understanding algorithms :D thanks. I appreciate your effort for helping a lot of students.

Peacelover
Автор

This gold right here. I have a question though why did you add start and end? Why didnt you do n-1/2?? Thanks!

kid_kulafu_
Автор

My fav youtuber...wish I could have you as my lecturer 🤗

light_clover
Автор

Can u please upload a video on prims, krushkals, job sequencing algorithms.

sarvanividela
Автор

bro!!... u really made it very clear!!!... i never thought it would be so easy... keep up the good work!!!

tomjerry