Documentation
¶
Index ¶
- type AVL
- func (t *AVL) Ascending() []interface{}
- func (t *AVL) AscendingJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) Descending() []interface{}
- func (t *AVL) DescendingJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) GetHeight() float64
- func (t *AVL) GetSize() int
- func (t *AVL) Insert(basicData interface{})
- func (t *AVL) InsertJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) LevelOrder() []interface{}
- func (t *AVL) LevelOrderJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) Postorder() []interface{}
- func (t *AVL) PostorderJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) Preorder() []interface{}
- func (t *AVL) PreorderJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) Remove(basicData interface{}) bool
- func (t *AVL) RemoveJS(this js.Value, args []js.Value) interface{}
- func (t *AVL) Retrieve(basicData interface{}) interface{}
- func (t *AVL) RetrieveJS(this js.Value, args []js.Value) interface{}
- type Float
- type Int
- type Interface
- type Object
- type String
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AVL ¶
type AVL struct {
// contains filtered or unexported fields
}
AVL type represents a container for an AVL tree.
func NewAVL ¶
func NewAVL() *AVL
NewAVL returns a new and empty AVL tree. Additionally, the exported AVL functions will be registered as callable Javascript functions. This allows the AVL library to function as a WASM module.
func (*AVL) Ascending ¶
func (t *AVL) Ascending() []interface{}
Ascending is a wrapper function for the recursive ascending traversal function.
func (*AVL) AscendingJS ¶
AscendingJS is a wrapper function for the AVL tree Ascending traversal.
func (*AVL) Descending ¶
func (t *AVL) Descending() []interface{}
Descending is a wrapper function for recursive descending traversal function.
func (*AVL) DescendingJS ¶
DescendingJS is a wrapper function for the AVL tree Descending traversal.
func (*AVL) Insert ¶
func (t *AVL) Insert(basicData interface{})
Insert is a wrapper function for the recursive insert function. It converts the argument data (basicData) passed in into a generic form, then passes it to the recursive insert function.
func (*AVL) LevelOrder ¶
func (t *AVL) LevelOrder() []interface{}
LevelOrder is an iterative function which traverses the AVL tree in level-order, appending each element within a level to a slice, and appending each slice to another slice. This slice of slices is returned once the traversal is finished. In normal terms, the return type is just a 2D-array where each array represents a level, and the elements within each array represent the elements within a level. This traversal is achieved by using the BFS algorithm.
func (*AVL) LevelOrderJS ¶
LevelOrderJS is a wrapper function for the AVL tree LevelOrder traversal.
func (*AVL) Postorder ¶
func (t *AVL) Postorder() []interface{}
Postorder is a wrapper function for recursive postorder traversal function.
func (*AVL) PostorderJS ¶
PostorderJS is a wrapper function for the AVL tree Postorder traversal.
func (*AVL) Preorder ¶
func (t *AVL) Preorder() []interface{}
Preorder is a wrapper function for recursive preorder traversal function.
func (*AVL) PreorderJS ¶
PreorderJS is a wrapper function for the AVL tree Preorder traversal.
func (*AVL) Remove ¶
Remove is a wrapper function for the recursive remove function. It converts the argument data (basicData) passed in into a generic form, then passes it to the recursive remove function.