d18

package
v0.0.0-...-3cf76cc Latest Latest
Warning

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

Go to latest
Published: Dec 25, 2020 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ModifiedShuntingYard

func ModifiedShuntingYard(tokens []string) (int, error)

ModifiedShuntingYard converts tokens to RPN but without operator precedence

func ModifiedShuntingYard2

func ModifiedShuntingYard2(tokens []string) (int, error)

ModifiedShuntingYard2 converts tokens to RPN but without operator precedence

func ParseInput

func ParseInput(f []byte) [][]string

ParseInput ..

func SolvePart1

func SolvePart1(tokens [][]string) (int, error)

SolvePart1 ..

func SolvePart2

func SolvePart2(tokens [][]string) (int, error)

SolvePart2 ..

Types

type Node

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

Node ..

type NodeQueue

type NodeQueue []*Node

NodeQueue ..

func (*NodeQueue) MustPop

func (q *NodeQueue) MustPop() *Node

MustPop ..

func (*NodeQueue) Pop

func (q *NodeQueue) Pop() (*Node, bool)

Pop ..

func (*NodeQueue) Push

func (q *NodeQueue) Push(n *Node)

Push ..

type NodeStack

type NodeStack []*Node

NodeStack ..

func (*NodeStack) MustPop

func (s *NodeStack) MustPop() *Node

MustPop ..

func (*NodeStack) Pop

func (s *NodeStack) Pop() (*Node, bool)

Pop ..

func (*NodeStack) Push

func (s *NodeStack) Push(n *Node)

Push ..

Jump to

Keyboard shortcuts

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