package
module
Version:
v0.0.0-...-8674f52
Opens a new window with list of versions in this module.
Published: Dec 29, 2016
License: MIT
Opens a new window with license information.
Imports: 2
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
Stack
LIFO data structure
Index
###New
###Empty
###Pop
###Push
###Reverse
###Size
###Swap
###Top
Documentation
¶
Stack represents the LIFO data structure.
Constructor for Stack.
If params is empty, it will new a empty Stack.
Or you can pass a List to initialize the Stack.
Check whether the Stack is empty or not.
Delete the top value in Stack.
If the Stack is empty, it will do nothing.
func (sta *Stack) Push(val interface{})
Insert the value above the top.
func (sta *Stack) Reverse()
Reverse the contents in the Stack.
Swap the contents of two Stacks.
func (sta *Stack) Top() interface{}
Get the top value in Stack.
If the Stack is empty, you will get nil.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.