Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/posabsolute/javascript-binary-search-algorithm
A small wrapper that implement the binary search algorithm in javascript
https://github.com/posabsolute/javascript-binary-search-algorithm
Last synced: 25 days ago
JSON representation
A small wrapper that implement the binary search algorithm in javascript
- Host: GitHub
- URL: https://github.com/posabsolute/javascript-binary-search-algorithm
- Owner: posabsolute
- Created: 2010-11-12T02:33:16.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2010-11-12T02:42:46.000Z (almost 14 years ago)
- Last Synced: 2024-04-15T03:01:03.175Z (7 months ago)
- Language: JavaScript
- Homepage: http://www.position-absolute.com/articles/optimizing-a-search-functionality-with-large-javascript-arrays/
- Size: 93.8 KB
- Stars: 15
- Watchers: 5
- Forks: 5
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
# Binary search algorithm
With this little helper you just pass your array and what you are looking for and it will return you back a result array, a typical use would look like this:
var searchResult = searchBinary("m", array, true)
the parameters are : searchBinary(search string, array to search, case insensitive?)This will return an array with all items starting by the letter m. A good use of this script would be with a auto-complete widget.
For more informations: http://www.position-absolute.com/articles/optimizing-a-search-functionality-with-large-javascript-arrays/