Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FiboNPolynomial ¶
FiboNPolynomial gets the `n`th Fibonacci Number which starts with 1, 1, 2, ... with polynomial formula.
func FiboNRecursive ¶
FiboNRecursive gets the `n`th Fibonacci Number which starts with 1, 1, 2, ... with recursion.
func MergeSort ¶
func MergeSort(nums []int)
MergeSort sorts a number array with merge-sort algorithm
func QuickSort ¶
func QuickSort(nums []int)
QuickSort sorts a number array with quick-sort algorithm
Types ¶
type Queue ¶
Queue is a high memory efficient queue. It uses bucket to cache data and reuses the buckets.
func (*Queue) Enqueue ¶
func (q *Queue) Enqueue(v interface{})
Enqueue pushes a value into the queue.
type Queuer ¶
type Queuer interface {
Enqueue(v interface{})
Dequeue() (v interface{}, ok bool)
// contains filtered or unexported methods
}
Queuer interface for queue
Click to show internal directories.
Click to hide internal directories.