eytzinger

package module
v0.0.0-...-cd9c2f8 Latest Latest
Warning

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

Go to latest
Published: Aug 12, 2023 License: MIT Imports: 2 Imported by: 0

README

go-eytzinger

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Eytzinger

func Eytzinger[S ~[]E, E any](a S) S

Eytzinger rearranges the elements of a slice into a cache friendly binary tree as known as Eytzinger Layout. The slice must be sorted in increasing order.

func IsEytzinger

func IsEytzinger[S ~[]E, E cmp.Ordered](a S) bool

IsEytzinger reports whether a slice is in Eytzinger Layout.

func Search[S ~[]E, E cmp.Ordered](x S, target E) (int, bool)

Search searches for target in a Eytzinger Layout slice.

func SearchFunc

func SearchFunc[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool)

SearchFunc works like Search but uses a custom comparison function. The slice must be ordered by Eytzinger Layout.

Types

This section is empty.

Jump to

Keyboard shortcuts

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