unordered_set

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2021 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type UnorderedSet

type UnorderedSet[T comparable] struct {
	// contains filtered or unexported fields
}

UnorderedSet is unordered unordered_set based on standard map It can contain comparable elements only

func NewUnorderedSet

func NewUnorderedSet[T comparable]() *UnorderedSet[T]

func (*UnorderedSet[T]) Contains

func (s *UnorderedSet[T]) Contains(item T) bool

Contains checks if Set contains given element. Complexity - O(1). returns true if Set includes the element, false otherwise.

func (*UnorderedSet[T]) Empty

func (s *UnorderedSet[T]) Empty() bool

Empty checks if there are elements in Set. Complexity - O(1). Returns true if the unordered_set is empty, false otherwise.

func (*UnorderedSet[T]) Erase

func (s *UnorderedSet[T]) Erase(item T)

Erase deletes the element from unordered_set if it contains an element does nothing otherwise. Complexity - O(1).

func (*UnorderedSet[T]) Insert

func (s *UnorderedSet[T]) Insert(item T)

Insert inserts element into Set. Complexity - O(1).

func (*UnorderedSet[T]) Size

func (s *UnorderedSet[T]) Size() int

Size returns the number of elements in the container. Complexity - O(1).

Jump to

Keyboard shortcuts

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