stack

package
v0.0.0-...-f52cd5e Latest Latest
Warning

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

Go to latest
Published: Oct 31, 2014 License: MIT Imports: 1 Imported by: 0

README

stack

View the docs

Installation
$ go get github.com/domluna/container/stack
Example

import "github.com/domluna/container/stack"

func main() {
  s := stack.New()
  s.Push(22)
  s.Push(55)
  v := t.Pop() // v = 55
  v := t.Pop() // v = 22
  v := t.Get() // v = nil
}

Documentation

Overview

Package stack implements the Stack(http://en.wikipedia.org/wiki/Stack_(abstract_data_type)) data structure

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Stack

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

Stack is a stack data structure.

func New

func New() *Stack

New creates a new Stack.

func (*Stack) Pop

func (s *Stack) Pop() interface{}

Pop removes an element from the top of the stack.

func (*Stack) Push

func (s *Stack) Push(v interface{})

Push inserts an element at the top of the stack.

Jump to

Keyboard shortcuts

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