sparse

package
v0.0.0-...-4f22fb0 Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrOutOfRange = errors.New("index out of range")
)

Functions

This section is empty.

Types

type Array

type Array interface {
	Set(i int)
	Unset(i int)
	Get(i int) bool
}

Array represents a sparse array that is able to store the presence of an element (rather than the element itself). This is most useful when an element represents a letter of some alphabet (i.e the English alphabet, which has 26 letters). Since Array is backed by a uint64, it can store up to 64 possible characters, meaning the base64 alphabet can be represented.

func New

func New() Array

New creates a new Array with no elements.

Jump to

Keyboard shortcuts

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