TRIVIAL go fmt

This commit is contained in:
Dan Buch 2012-11-18 20:21:16 -05:00
parent e99e5165bd
commit 9cb1be13fe

View File

@ -1,21 +1,21 @@
package algs4
func BinarySearchRank(key int, a []int) int {
lo := 0
hi := len(a) - 1
lo := 0
hi := len(a) - 1
var mid int
var mid int
for lo <= hi {
mid = lo + (hi - lo) / 2
if key < a[mid] {
hi = mid - 1
} else if key > a[mid] {
lo = mid + 1
} else {
return mid
}
}
for lo <= hi {
mid = lo + (hi-lo)/2
if key < a[mid] {
hi = mid - 1
} else if key > a[mid] {
lo = mid + 1
} else {
return mid
}
}
return -1
return -1
}