Search Options

Results per page
Sort
Preferred Languages
Advance

Results 1 - 1 of 1 for ExampleBinarySearchFunc (0.37 sec)

  1. src/slices/example_test.go

    	fmt.Println("Vera:", n, found)
    	n, found = slices.BinarySearch(names, "Bill")
    	fmt.Println("Bill:", n, found)
    	// Output:
    	// Vera: 2 true
    	// Bill: 1 false
    }
    
    func ExampleBinarySearchFunc() {
    	type Person struct {
    		Name string
    		Age  int
    	}
    	people := []Person{
    		{"Alice", 55},
    		{"Bob", 24},
    		{"Gopher", 13},
    	}
    Registered: Wed Jun 12 16:32:35 UTC 2024
    - Last Modified: Fri May 10 17:28:50 UTC 2024
    - 8.1K bytes
    - Viewed (0)
Back to top