package main
import (
"fmt"
"strconv"
)
func LinearSearch(a []int, k int) string {
i := 0
for i < len(a) {
if a[i] == k {
return "Found" + " index is " + strconv.Itoa(i)
}
i += 1
}
return "Not found index"
}
func main() {
a := []int{10, 20, 30, 40, 50}
fmt.Println(LinearSearch(a, 50))
}
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (0)