Discover Packages
github.com/shogo82148/go-eytzinger
package
module
Version:
v0.0.0-...-cd9c2f8
Opens a new window with list of versions in this module.
Published: Aug 12, 2023
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
README
¶
Expand ▾
Collapse ▴
Documentation
¶
func Eytzinger[S ~[]E, E any](a S) S
func IsEytzinger[S ~[]E, E cmp.Ordered](a S) bool
func Search[S ~[]E, E cmp.Ordered](x S, target E) (int, bool)
func SearchFunc[S ~[]E, E, T any](x S, target T, cmp func(E, T) int) (int, bool)
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.
IsEytzinger reports whether a slice is in Eytzinger Layout.
Search searches for target in a Eytzinger Layout slice.
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.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.