godatastructures

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 26, 2025 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DynamicArray

type DynamicArray[T any] struct {
	// contains filtered or unexported fields
}

func NewDynamicArray

func NewDynamicArray[T any](size int) *DynamicArray[T]

func (*DynamicArray[T]) Append

func (da *DynamicArray[T]) Append(item T)

func (*DynamicArray[T]) Clear

func (da *DynamicArray[T]) Clear()

func (*DynamicArray[T]) Get

func (da *DynamicArray[T]) Get(index int) (T, error)

func (*DynamicArray[T]) IsEmpty

func (da *DynamicArray[T]) IsEmpty() bool

func (*DynamicArray[T]) Pop

func (da *DynamicArray[T]) Pop() (T, error)

func (*DynamicArray[T]) Set

func (da *DynamicArray[T]) Set(index int, item T) error

func (*DynamicArray[T]) Size

func (da *DynamicArray[T]) Size() int

func (*DynamicArray[T]) String

func (da *DynamicArray[T]) String() string

func (*DynamicArray[T]) Swap

func (da *DynamicArray[T]) Swap(index1, index2 int) error

type Err

type Err string

func (Err) Error

func (err Err) Error() string

type MinHeap

type MinHeap[T constraints.Ordered] struct {
	// contains filtered or unexported fields
}

func NewMinHeap

func NewMinHeap[T constraints.Ordered]() *MinHeap[T]

func (*MinHeap[T]) Insert

func (h *MinHeap[T]) Insert(item T)

func (*MinHeap[T]) IsEmpty

func (h *MinHeap[T]) IsEmpty() bool

func (*MinHeap[T]) Peek

func (h *MinHeap[T]) Peek() (T, error)

func (*MinHeap[T]) Pop

func (h *MinHeap[T]) Pop() (T, error)

func (*MinHeap[T]) Size

func (h *MinHeap[T]) Size() int

type Node

type Node[T any] struct {
	// contains filtered or unexported fields
}

type Queue

type Queue[T any] struct {
	// contains filtered or unexported fields
}

func NewQueue

func NewQueue[T any]() *Queue[T]

func (*Queue[T]) Clear

func (q *Queue[T]) Clear()

func (*Queue[T]) Dequeue

func (q *Queue[T]) Dequeue() (T, error)

func (*Queue[T]) Enqueue

func (q *Queue[T]) Enqueue(item T)

func (*Queue[T]) IsEmpty

func (q *Queue[T]) IsEmpty() bool

func (*Queue[T]) Peek

func (q *Queue[T]) Peek() (T, error)

func (*Queue[T]) Rear

func (q *Queue[T]) Rear() (T, error)

func (*Queue[T]) Size

func (q *Queue[T]) Size() int

type Stack

type Stack[T any] struct {
	// contains filtered or unexported fields
}

func NewStack

func NewStack[T any]() *Stack[T]

func (*Stack[T]) IsEmpty

func (s *Stack[T]) IsEmpty() bool

func (*Stack[T]) Peek

func (s *Stack[T]) Peek() (T, error)

func (*Stack[T]) Pop

func (s *Stack[T]) Pop() (T, error)

func (*Stack[T]) Push

func (s *Stack[T]) Push(item T)

func (*Stack[T]) Size

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

Jump to

Keyboard shortcuts

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