Documentation
¶
Overview ¶
Package stack provides implementation for Stack data structure https://simple.wikipedia.org/wiki/Stack_(data_structure)
Interface methods Push,Pop, Peek,IsEmpty,Size are the ways to interact with stack data structure. The test file stack_test.go illustrates usage of these methods
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Interface ¶
type Interface interface { // Push element to the stack Push(x interface{}) // Pop element from the top of the stack // If stack is empty, returns nil Pop() interface{} // Peek check the value of top element Peek() interface{} // IsEmpty returns true if stack is empty IsEmpty() bool // Size returns number of elements in the stack Size() int }
Interface implemented by stack, LIFO
Click to show internal directories.
Click to hide internal directories.