Binary Search
Binary Search algorithm implemented in Go (Golang) by using iteration.
Time Complexity: O(log(n))
Space Complexity: O(1)
$ 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