chapter8

package
v0.0.0-...-2a29fd4 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2015 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BSTSortedOrder

func BSTSortedOrder(root *BST) []int

func BinaryTreeLevelOrder

func BinaryTreeLevelOrder(root *BST) [][]int

func SearchPostingsListIterative

func SearchPostingsListIterative(head *PostingsListElement)

func SearchPostingsListRecursive

func SearchPostingsListRecursive(head *PostingsListElement)

func SlidingWindow

func SlidingWindow(t []TrafficElement, w int) []int

func StackSorting

func StackSorting(st *IntStack)

func TowerHanoi

func TowerHanoi(n int)

Types

type BST

type BST struct {
	Value int
	Left  *BST
	Right *BST
}

type IntStack

type IntStack []int

func ViewSunset

func ViewSunset(hs []int) IntStack

func (*IntStack) Pop

func (st *IntStack) Pop() (int, error)

func (*IntStack) Push

func (st *IntStack) Push(n int)

type PostingsListElement

type PostingsListElement struct {
	Value int
	Order int
	Next  *PostingsListElement
	Jump  *PostingsListElement
}

type PostingsListElementStack

type PostingsListElementStack []*PostingsListElement

func (*PostingsListElementStack) Pop

func (*PostingsListElementStack) Push

type QueueWithMax

type QueueWithMax struct {
	// contains filtered or unexported fields
}

func NewQueueWithMax

func NewQueueWithMax() *QueueWithMax

func (*QueueWithMax) Dequeue

func (qwm *QueueWithMax) Dequeue() (int, error)

func (*QueueWithMax) Enqueue

func (qwm *QueueWithMax) Enqueue(n int)

func (*QueueWithMax) Max

func (qwm *QueueWithMax) Max() (int, error)

type Stack

type Stack []*BST

func (*Stack) Pop

func (st *Stack) Pop() (*BST, error)

func (*Stack) Push

func (st *Stack) Push(x *BST)

type StackWithMax

type StackWithMax struct {
	// contains filtered or unexported fields
}

func (*StackWithMax) Max

func (s *StackWithMax) Max() (int, error)

func (*StackWithMax) Pop

func (s *StackWithMax) Pop() (int, error)

func (*StackWithMax) Push

func (s *StackWithMax) Push(x int)

type StackedQueue

type StackedQueue struct {
	// contains filtered or unexported fields
}

func NewStackedQueue

func NewStackedQueue() *StackedQueue

func (*StackedQueue) Dequeue

func (sq *StackedQueue) Dequeue() (int, error)

func (*StackedQueue) Enqueue

func (sq *StackedQueue) Enqueue(n int)

type TrafficElement

type TrafficElement struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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