Binary search algorithm in Java (code with step by explanation)

Published: 10 January 2018
on channel: Coding Time
453
14

Hello coders,
welcome to coding time this is the place you can find some very useful programming tutorials for both beginners and advanced.

This is a video of our data structures in Java series.

This video I have explained in very simple words that what is binary search and how you can write the code for binary search in Java the code is very easy to understand and very informative for both beginners and advanced programmers.

Binary search is a search technique used in data structures in which we search in array wether a particular element is presented in array or not.

Binary search can only work with sorted array.

Binary search divides the array in two parts left and right by taking a middle value.

All the values at the left of Array less than the middle value and all the values who are at the right of middle value are greater than the middle value. so first we compare the element with the middle value and if it is less than the middle value then we search to the left side of middle value and if it is greater than the middle value then we search to the right side of middle value.
that's how binary search works and that's why it is faster than the Linear search.

If you have liked the video then hit the like button to get updates of my latest videos subscribe to my channel.

for any queries you can write an email at noman.232626@gmail.com


On this page of the site you can watch the video online Binary search algorithm in Java (code with step by explanation) with a duration of hours minute second in good quality, which was uploaded by the user Coding Time 10 January 2018, share the link with friends and acquaintances, this video has already been watched 453 times on youtube and it was liked by 14 viewers. Enjoy your viewing!