bisect

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Example
package main

import (
	"fmt"

	"git.tcp.direct/Mirrors/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