algorithm

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 13, 2018 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BucketSort

func BucketSort(data []float64) []float64

BucketSort is bucket sort algorithm

func BuildHeap

func BuildHeap(arr []int)

BuildHeap build a heap for array

func DownAdjust

func DownAdjust(arr []int, parentIndex int, validLength int)

DownAdjust downadjust the node (replace the root node with last node)

func HeapSort

func HeapSort(arr []int)

HeapSort is heap sort

func PreorderTraversal

func PreorderTraversal(root *ALVNode) []int32

PreorderTraversal preorder traver

func QuickSort

func QuickSort(arr []int)

QuickSort for quick sort

func UpAdjust

func UpAdjust(arr []int)

UpAdjust upajust the last node (inserted new node situation)

Types

type ALVNode

type ALVNode struct {
	Data   int32
	LNode  *ALVNode
	RNode  *ALVNode
	Height int16
}

ALVNode alv tree node

func Insert

func Insert(data int32, root *ALVNode) *ALVNode

Insert insert node in alv tree

Jump to

Keyboard shortcuts

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