algorithm

package
v0.0.0-...-f0a3b70 Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinarySearch

func BinarySearch[T Number](sortedItems []T, searchItem T) int

BinarySearch searches an item using binary search algorithm

func LinearSearch

func LinearSearch[T Number](items []T, searchItem T) int

LinearSearch searches an item linearly

Types

type Number

type Number interface {
	int | int8 | int16 | int32 | int64 | float32 | float64
}

Jump to

Keyboard shortcuts

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