Javarevisited
Published in

Javarevisited

Binary Search — As Quick as Possible

These two approaches generally come to our minds in software development when we want to perform some searches.

  1. Linear Search
  2. Binary Search

Now, let’s assume we have a set of data and want to search for a key element.

  1. In linear search, we will start from one end, and one by one, compare every element in the data set.

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Ganesh Prasad

Ganesh Prasad

Writer (100K+ views) | Software Engineer | C++ veteran, 💜 Dart