Documentation
¶
Overview ¶
Package sort a package for demonstrating sorting algorithms in Go
Index ¶
- func Count(data []int) []int
- func Exchange(arr []int) []int
- func HeapSort(slice []int) []int
- func ImprovedSimpleSort(arr []int) []int
- func InsertionSort(arr []int) []int
- func Mergesort(items []int) []int
- func Pigeonhole(arr []int) []int
- func QuickSort(arr []int) []int
- func QuickSortRange(arr []int, low, high int)
- func RadixSort(arr []int) []int
- func SelectionSort(arr []int) []int
- func ShellSort(arr []int) []int
- func SimpleSort(arr []int) []int
- type Comparable
- type Int
- type MaxHeap
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ImprovedSimpleSort ¶
ImprovedSimpleSort is a improve SimpleSort by skipping an unnecessary comparison of the first and last. This improved version is more similar to implementation of insertion sort
func InsertionSort ¶
func Pigeonhole ¶
Pigeonhole sorts a slice using pigeonhole sorting algorithm.
func QuickSortRange ¶
QuickSortRange Sorts the specified range within the array
func SelectionSort ¶
func SimpleSort ¶
Types ¶
type Comparable ¶
type MaxHeap ¶
type MaxHeap struct {
// contains filtered or unexported fields
}
func (*MaxHeap) Init ¶
func (h *MaxHeap) Init(slice []Comparable)
func (*MaxHeap) Pop ¶
func (h *MaxHeap) Pop() Comparable
func (*MaxHeap) Push ¶
func (h *MaxHeap) Push(i Comparable)
func (MaxHeap) Update ¶
func (h MaxHeap) Update(i Comparable)
Click to show internal directories.
Click to hide internal directories.