bisect

package
v0.2.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 3, 2021 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Example
package main

import (
	"fmt"

	"github.com/c-bata/go-prompt/internal/bisect"
)

func main() {
	in := []int{1, 2, 3, 3, 3, 6, 7}
	fmt.Println("Insertion position for 0 in the slice is", bisect.Right(in, 0))
	fmt.Println("Insertion position for 4 in the slice is", bisect.Right(in, 4))

}
Output:

Insertion position for 0 in the slice is 0
Insertion position for 4 in the slice is 5

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Right(a []int, v int) int

Right to locate the insertion point for v in a to maintain sorted order.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL