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