Skip to content

mtchavez/binary-search-erl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

binary-search-erl

Build Status

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

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

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

About

Binary Search in Erlang

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages