Documentation
¶
Overview ¶
Copyright © 2024 Mark Summerfield. All rights reserved.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Comparable ¶
type Comparable interface {
~string | ~int | ~int8 | ~int16 | ~int32 | ~int64 |
~uint | ~uint8 | ~uint16 | ~uint32 | ~uint64 | ~uintptr
}
Comparable allows only string or integer elements.
type SortedSet ¶
type SortedSet[E Comparable] struct { // contains filtered or unexported fields }
SortedSet zero value is usable. Create with statements like these: var set SortedSet[string] set := SortedSet[int]{}
func (*SortedSet[E]) All ¶
All returns a for .. range iterable of the set's elements, e.g., for element := range tree.All()
func (*SortedSet[E]) Clear ¶
func (me *SortedSet[E]) Clear()
Clear deletes the entire tree. See also [Delete]
func (*SortedSet[E]) Contains ¶
Contains returns true if the element is in the tree; otherwise false. For example:
ok := set.Contains(element).
func (*SortedSet[E]) Delete ¶
Delete deletes the element-value with the given element from the set and returns true, or does nothing and returns false if there is no element-value with the given element. For example:
deleted := set.Delete(element).
See also [Clear]