An open API service indexing awesome lists of open source software.

https://github.com/mxssl/binarysearchgolangiteratively

Binary Search algorithm implemented in Go (Golang) by using iteration.
https://github.com/mxssl/binarysearchgolangiteratively

algorithm go golang

Last synced: 8 months ago
JSON representation

Binary Search algorithm implemented in Go (Golang) by using iteration.

Awesome Lists containing this project

README

          

# Binary Search

[Binary Search](https://en.wikipedia.org/wiki/Binary_search_algorithm) algorithm implemented in Go (Golang) by using iteration.

`Time Complexity: O(log(n))`

`Space Complexity: O(1)`

```Bash
$ go test -v -cover ./...
=== RUN TestCase1
Expected: 3, Output: 3
--- PASS: TestCase1 (0.00s)
=== RUN TestCase2
Expected: -1, Output: -1
--- PASS: TestCase2 (0.00s)
PASS
coverage: 78.6% of statements
ok github.com/mxssl/BinarySearchGolangIteratively 0.156s coverage: 78.6% of statements
```