Documentation
¶
Index ¶
Constants ¶
View Source
const ( RED = true BLACK = false )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AVLNode ¶
Node представляет узел AVL-дерева
func LeftRotate ¶
LeftRotate выполняет левый поворот вокруг узла
func RightRotate ¶
RightRotate выполняет правый поворот вокруг узла
type AVLTree ¶
type AVLTree struct {
Root *AVLNode
}
AVLTree представляет AVL-дерево
func (*AVLTree) InOrderTraversal ¶
InOrderTraversal выполняет обход дерева в симметричном порядке
type BST ¶
type BST struct {
Root *NodeBST
}
представляет бинарное дерево поиска
func (*BST) InOrderTraversal ¶
выполняет обход дерева в симметричном порядке
func (*BST) PostOrderTraversal ¶
выполняет обход дерева в постордерном порядке
func (*BST) PreOrderTraversal ¶
выполняет обход дерева в предварительном порядке
type NodeRBT ¶
type NodeRBT struct { Value int Color bool // true - красный, false - черный Left *NodeRBT Right *NodeRBT Parent *NodeRBT }
Узел красно-черного дерева
type RedBlackTree ¶
type RedBlackTree struct {
Root *NodeRBT
}
Красно-черное дерево
func (*RedBlackTree) InOrderTraversal ¶
func (t *RedBlackTree) InOrderTraversal() []int
Обход дерева in-order и возврат результата в виде слайса
Click to show internal directories.
Click to hide internal directories.