https://github.com/r-barnes/ravl
AVL self-balancing binary tree class
https://github.com/r-barnes/ravl
Last synced: 2 months ago
JSON representation
AVL self-balancing binary tree class
- Host: GitHub
- URL: https://github.com/r-barnes/ravl
- Owner: r-barnes
- Created: 2013-06-25T21:47:39.000Z (almost 12 years ago)
- Default Branch: master
- Last Pushed: 2013-07-16T22:42:08.000Z (almost 12 years ago)
- Last Synced: 2025-01-26T19:11:19.484Z (4 months ago)
- Language: C++
- Homepage:
- Size: 141 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
RAVL: (Richard's) AVL Tree Class
================================An AVL tree is a form of self-balancing binary tree.
Many AVL tree implementations are difficult to understand, or do not include
a method to remove items from the tree. This class is, I think, cleanly written
and includes **insert** and **remove** methods, as well as various methods for
walking the tree.Usage
-----
Make a new tree with: `AvlTree tree;`Add a node to the tree with: `tree.insert(3)`
Remove a node from the tree with: `tree.remove(3)`
Return the root of the tree with `tree.top()`
Return and remove the tree's root with: `tree.pop()`
Print a LaTeX qtree representation of the tree with `tree.qtreePrint(cout);`
Print a GraphViz DOT representation of the tree with `tree.print_dot(cout);`
Print the tree breadth-first from the root with `tree.levelPrint(cout);`