ds

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Aug 29, 2019 License: ISC Imports: 0 Imported by: 0

README

ds

Data Structure Description
Queue First-in first-out (FIFO)
Stack Last-in first-out (LIFO)

heap

Heap Description
MinHeap Min-Heap priority queue
MaxHeap Max-Heap priority queue

st

Symbol Table Ordered Self-Balancing Description
BST Yes No Binary search tree
AVL Yes Yes AVL binary search tree
RedBlack Yes Yes Red-Black binary search tree

Documentation

Overview

Package ds provides basic data structures.

Deprecated: this package has been frozen and deprecated in favor of github.com/moorara/algo/ds

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Queue

type Queue interface {
	Size() int
	IsEmpty() bool
	Enqueue(interface{})
	Dequeue() interface{}
	Peek() interface{}
	Contains(interface{}) bool
}

Queue represents a stack data structure

func NewQueue

func NewQueue(nodeSize int, compare func(a, b interface{}) int) Queue

NewQueue creates a new array-list queue

type Stack

type Stack interface {
	Size() int
	IsEmpty() bool
	Push(interface{})
	Pop() interface{}
	Peek() interface{}
	Contains(interface{}) bool
}

Stack represents a stack data structure

func NewStack

func NewStack(nodeSize int, compare func(a, b interface{}) int) Stack

NewStack creates a new array-list stack

Directories

Path Synopsis
Package heap provides min heap and max heap data structures.
Package heap provides min heap and max heap data structures.
Package st provides symbol table data structures.
Package st provides symbol table data structures.

Jump to

Keyboard shortcuts

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