Skip to content

Latest commit

 

History

6 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

binary-search

binary search , really fast way to find thing in a sorted list

Co-authored by sighthough and Googles Gemini.

watch it in action just pick a number from the list of numbers and start it then click next until it finds it :D

👉 CLICK HERE TO TRY

the index file is the demonstration and it has the code in there marked so that you can rip it and use it for your own projects ! enjoy :3

the main idea behind it is halving the search space like if you define your list from 0-100 percent then what you do is start with 50 percent, see if its above or below then move 25 percent the way it is (half of 50!) then move 12.5 percent the way it is (half of 25!) then move 6.25 percent the way it is (half of 12.5) and so on until you find it :D

example : you start at 50 percent , see its above you move to 75 percent (25 half of 50) then you see its below you move to 62.5 (12.5 half of 25) then if you see its below again you move to 56.25 (6.25 half of 12.5) etc etc until you find it :D

About

binary search , really fast way to find thing in a sorted list

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages