All Projects → ancientlore → go-avltree

ancientlore / go-avltree

Licence: MIT license
AVL tree with some useful extensions written in Go

Programming Languages

go
31211 projects - #10 most used programming language

Projects that are alternatives of or similar to go-avltree

Data-Structures-and-Algorithms
Implementation of various Data Structures and algorithms - Linked List, Stacks, Queues, Binary Search Tree, AVL tree,Red Black Trees, Trie, Graph Algorithms, Sorting Algorithms, Greedy Algorithms, Dynamic Programming, Segment Trees etc.
Stars: ✭ 144 (+396.55%)
Mutual labels:  tree, avl-tree
avl array
High performance templated AVL tree using a fixed size array. Extensive test suite passing.
Stars: ✭ 33 (+13.79%)
Mutual labels:  tree, avl-tree
Data Structures
Go datastructures.
Stars: ✭ 336 (+1058.62%)
Mutual labels:  tree, avl-tree
Libdict
C library of key-value data structures.
Stars: ✭ 234 (+706.9%)
Mutual labels:  tree, avl-tree
Javascript Datastructures Algorithms
📚 collection of JavaScript and TypeScript data structures and algorithms for education purposes. Source code bundle of JavaScript algorithms and data structures book
Stars: ✭ 3,221 (+11006.9%)
Mutual labels:  tree, avl-tree
Gods
GoDS (Go Data Structures). Containers (Sets, Lists, Stacks, Maps, Trees), Sets (HashSet, TreeSet, LinkedHashSet), Lists (ArrayList, SinglyLinkedList, DoublyLinkedList), Stacks (LinkedListStack, ArrayStack), Maps (HashMap, TreeMap, HashBidiMap, TreeBidiMap, LinkedHashMap), Trees (RedBlackTree, AVLTree, BTree, BinaryHeap), Comparators, Iterators, …
Stars: ✭ 10,883 (+37427.59%)
Mutual labels:  tree, avl-tree
Containers
This library provides various containers. Each container has utility functions to manipulate the data it holds. This is an abstraction as to not have to manually manage and reallocate memory.
Stars: ✭ 125 (+331.03%)
Mutual labels:  tree, avl-tree
Computer Science In Javascript
Computer science reimplemented in JavaScript
Stars: ✭ 2,590 (+8831.03%)
Mutual labels:  tree
vuejs-tree
A highly customizable and blazing fast Vue tree component ⚡🌲
Stars: ✭ 310 (+968.97%)
Mutual labels:  tree
Dsladapter
🔥 Kotlin时代的Adapter, Dsl 的形式使用 RecyclerView.Adapter, 支持折叠展开, 树结构,悬停,情感图状态切换, 加载更多, 多类型Item,侧滑菜单等
Stars: ✭ 231 (+696.55%)
Mutual labels:  tree
Element Tree Grid
tree grid extends element ui with vue
Stars: ✭ 223 (+668.97%)
Mutual labels:  tree
mongodb-tree-structure
Implementing Tree Structure in MongoDB
Stars: ✭ 14 (-51.72%)
Mutual labels:  tree
react-vertical-tree
Simple & lightweight vertical tree like view.
Stars: ✭ 23 (-20.69%)
Mutual labels:  tree
Merkletree
A Merkle Tree implementation written in Go.
Stars: ✭ 236 (+713.79%)
Mutual labels:  tree
jquery-tree
jQuery-tree is a jQuery plugin to make an HTML unorder list (ul) in a tree.
Stars: ✭ 29 (+0%)
Mutual labels:  tree
beehive
A flexible, modern, header-only implementation of behavior trees
Stars: ✭ 37 (+27.59%)
Mutual labels:  tree
Scikit Garden
A garden for scikit-learn compatible trees
Stars: ✭ 230 (+693.1%)
Mutual labels:  tree
data-structure-project
自己实现集合框架系列整理总结
Stars: ✭ 29 (+0%)
Mutual labels:  tree
JLBoost.jl
A 100%-Julia implementation of Gradient-Boosting Regression Tree algorithms
Stars: ✭ 65 (+124.14%)
Mutual labels:  tree
RedisTree
Redis Tree (Ploytree) Structure Module
Stars: ✭ 64 (+120.69%)
Mutual labels:  tree

go-avltree

Go Reference

An AVL tree (Adel'son-Vel'skii & Landis) is a binary search tree in which the heights of the left and right subtrees of the root differ by at most one and in which the left and right subtrees are again AVL trees.

With each node of an AVL tree is associated a balance factor that is Left High, Equal, or Right High according, respectively, as the left subtree has height greater than, equal to, or less than that of the right subtree.

The AVL tree is, in practice, balanced quite well. It can (at the worst case) become skewed to the left or right, but never so much that it becomes inefficient. The balancing is done as items are added or deleted.

This version is enhanced to allow "indexing" of values in the tree; however, the indexes are not stable as the tree could be resorted as items are added or removed.

It is safe to iterate or search a tree from multiple threads provided that no threads are modifying the tree.

The tree works on generic types and there is also a specialization for maps. Additionally, the tree supports iteration and a channel iterator.

t.Do(func(z int) bool {
	if z % 3333 == 0 {
		fmt.Printf("%d ", z)
	}
	return true
})

for v := range t.Iter() {
    	if v % 3333 == 0 {
            	fmt.Printf("%d ", v);
    	}
}

To install, you can use:

go get github.com/ancientlore/go-avltree/v2@latest

For more information on generics see:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].