Skip to content

Instantly share code, notes, and snippets.

@sklrsn
sklrsn / binarysearch.go
Last active July 24, 2017 18:59
Binary Search Implementation in Golang
package main
import "fmt"
func Binarysearch(a []int, key int) bool {
left := 0
right := len(a)
for left <= right {
mid := (left + right) / 2