Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mtchavez/binary-search-erl
Binary Search in Erlang
https://github.com/mtchavez/binary-search-erl
binary-search erlang
Last synced: about 2 months ago
JSON representation
Binary Search in Erlang
- Host: GitHub
- URL: https://github.com/mtchavez/binary-search-erl
- Owner: mtchavez
- Created: 2013-04-03T02:26:34.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-04-03T18:06:38.000Z (almost 12 years ago)
- Last Synced: 2023-03-17T04:45:31.124Z (almost 2 years ago)
- Topics: binary-search, erlang
- Language: Erlang
- Size: 109 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
binary-search-erl
=================[![Build Status](https://travis-ci.org/mtchavez/binary-search-erl.png?branch=master)](https://travis-ci.org/mtchavez/binary-search-erl)
Binary Search in Erlang
## Usage
Takes a list of integers to run a binary search on.
### Searching
With a list you can search for a specific value
```erlang
c(binarysearch).
List = [5,1,4,6,-1,40,203,8,343,1,-1212, 55].
binarysearch:search(List, 343).
% returns {{value, 343}, {position, 12}}
```When there are no results this is what will be returned
```erlang
c(binarysearch).
List = [5,1,4,6,-1,40,203,8,343,1,-1212, 55].
binarysearch:search(List, 999).
% returns {notfound, 999}
```### Running Tests
Tests can be run with ```rebar eunit```.
Coverage will be output at ```.eunit/index.html```
## License
Written by Chavez
Released under the MIT License: http://www.opensource.org/licenses/mit-license.php