Documentation
¶
Overview ¶
Package non_linear_data_structure Time : 2021/5/16 2:15 下午 Author : xushiyin contact : yuqingxushiyin@gmail.com Adelson, Velski, and Landis pioneered the AVL tree data structure and hence it is named after them. It consists of height adjusting binary search trees. The balance factor is obtained by finding the difference between the heights of the left and right sub-trees. Balancing is done using rotation techniques. If the balance factor is greater than one, rotation shifts the nodes to the opposite of the left or right sub-trees. The search, addition, and deletion operations are processed in the order of O(log n).
Package non_linear_data_structure Time : 2021/5/11 8:46 下午 Author : xushiyin contact : yuqingxushiyin@gmail.com
Package non_linear_data_structure Time : 2021/5/21 4:43 下午 Author : xushiyin contact : yuqingxushiyin@gmail.com
Index ¶
- func InsertNode(treeNode **AVLTreeNode, key KeyValue)
- func PrintTable(t Table)
- func RemoveNode(treeNode **AVLTreeNode, key KeyValue)
- type AVLTreeNode
- type BinarySearchTree
- func (tree *BinarySearchTree) InOrderTraverseTree(function func(int))
- func (tree *BinarySearchTree) InsertElement(key int, value int)
- func (tree *BinarySearchTree) MaxNode() *int
- func (tree *BinarySearchTree) MinNode() *int
- func (tree *BinarySearchTree) PostOrderTraverseTree(function func(int))
- func (tree *BinarySearchTree) PreOrderTraverseTree(function func(int))
- func (tree *BinarySearchTree) RemoveNode(key int)
- func (tree *BinarySearchTree) SearchNode(key int) bool
- func (tree *BinarySearchTree) String()
- type Column
- type IntegerKey
- type KeyValue
- type Row
- type Table
- type TreeNode
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AVLTreeNode ¶
type AVLTreeNode struct {
KeyValue KeyValue
BalanceValue int
LinkedNodes [2]*AVLTreeNode
}
AVLTreeNode class
func BalanceTree ¶
func BalanceTree(rootNode *AVLTreeNode, nodeValue int) *AVLTreeNode
BalanceTree method changes the balance factor by a single or double rotation
type BinarySearchTree ¶
type BinarySearchTree struct {
// contains filtered or unexported fields
}
BinarySearchTree class
func (*BinarySearchTree) InOrderTraverseTree ¶
func (tree *BinarySearchTree) InOrderTraverseTree(function func(int))
InOrderTraverseTree method
func (*BinarySearchTree) InsertElement ¶
func (tree *BinarySearchTree) InsertElement(key int, value int)
InsertElement method
func (*BinarySearchTree) PostOrderTraverseTree ¶
func (tree *BinarySearchTree) PostOrderTraverseTree(function func(int))
PostOrderTraverseTree method
func (*BinarySearchTree) PreOrderTraverseTree ¶
func (tree *BinarySearchTree) PreOrderTraverseTree(function func(int))
PreOrderTraverseTree method
func (*BinarySearchTree) RemoveNode ¶
func (tree *BinarySearchTree) RemoveNode(key int)
RemoveNode method
func (*BinarySearchTree) SearchNode ¶
func (tree *BinarySearchTree) SearchNode(key int) bool
SearchNode method
type IntegerKey ¶
type IntegerKey int
func (IntegerKey) EqualTo ¶
func (k IntegerKey) EqualTo(k1 KeyValue) bool
func (IntegerKey) LessThan ¶
func (k IntegerKey) LessThan(k1 KeyValue) bool