ds

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jun 9, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compare

func Compare[T Lesser[T]](a, b T) int

Compare compares a and b and returns -1, 0 or 1 if a is less-than, equal-to or greater-than b, respectively.

Types

type Lesser

type Lesser[T any] interface {
	comparable

	// Less returns true if this value is less than the other.
	Less(other T) bool
}

Lesser defines types that can be compared to check for equality or to find the least. It is essential for ordered data-structures such as heaps, search trees and sorted sets.

Directories

Path Synopsis
Package heap provides the implementation of a generic binary heap.
Package heap provides the implementation of a generic binary heap.
Package heap provides the implementation of a generic circular queue.
Package heap provides the implementation of a generic circular queue.
Package sorted provides the implementation of a generic sorted list.
Package sorted provides the implementation of a generic sorted list.

Jump to

Keyboard shortcuts

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