Below you will find pages that utilize the taxonomy term “Search”
March 13, 2024
Back to the basics with BASIC (and Python): Binary Search
Back to the basics with basic
Let’s say for a moment that we’ve got an ordered list of numbers.
1,3,5,7,9,11,13,15,17,19,21,23,25
There are 13 values here and we want to check if the number 25
is in this list.
One way to do this would be to loop over each element in the list and check to see if it matches what we’re looking for.
In BASIC, we’d do something like