paint-brush
How to Find Your Number in a Sorted List: Binary Search Explainedby@mohsiss
323 reads
323 reads

How to Find Your Number in a Sorted List: Binary Search Explained

by Icodes2mOctober 3rd, 2021
Read on Terminal Reader
Read this story w/o Javascript
tldt arrow

Too Long; Didn't Read

Binary search is another fairly efficient way of searching for things. It's a logarithmic algorithm that relies on having a sorted list. And what you do with binary search is you go to the middle item of this sorted list and if that's the item you're looking for then that's it. If not, you discard half of the items in the list (either from the left or right side depending on whether the current selection is lesser or greater than the search item). You again start in the middle of the new list and keep on repeating this process until you reach your desired search item.

Company Mentioned

Mention Thumbnail
featured image - How to Find Your Number in a Sorted List: Binary Search Explained
Icodes HackerNoon profile picture
Icodes

Icodes

@mohsiss

A python programmer and founder of blog.icodes.tech programming blog

About @mohsiss
LEARN MORE ABOUT @MOHSISS'S
EXPERTISE AND PLACE ON THE INTERNET.
L O A D I N G
. . . comments & more!

About Author

Icodes HackerNoon profile picture
Icodes@mohsiss
A python programmer and founder of blog.icodes.tech programming blog

TOPICS

THIS ARTICLE WAS FEATURED IN...

Permanent on Arweave
Read on Terminal Reader
Read this story in a terminal
 Terminal
Read this story w/o Javascript
Read this story w/o Javascript
 Lite
Also published here