Algorithms_in_C++ 1.0.0
Set of algorithms implemented in C++.
|
A simple tree implementation using nodes. More...
#include <algorithm>
#include <iostream>
#include <queue>
Typedefs | |
using | node |
for std::queue | |
Functions | |
node * | createNode (int data) |
creates and returns a new node | |
int | height (node *root) |
int | getBalance (node *root) |
node * | rightRotate (node *root) |
node * | leftRotate (node *root) |
node * | minValue (node *root) |
node * | insert (node *root, int item) |
inserts a new element into AVL tree | |
node * | deleteNode (node *root, int element) |
removes a given element from AVL tree | |
void | deleteAllNodes (const node *const root) |
calls delete on every node | |
void | levelOrder (node *root) |
prints given tree in the LevelOrder | |
int | main () |
Main function. | |
A simple tree implementation using nodes.
using node |
for std::queue
node * createNode | ( | int | data | ) |
creates and returns a new node
[in] | data | value stored in the node |
void deleteAllNodes | ( | const node *const | root | ) |
calls delete on every node
root | of the tree |
removes a given element from AVL tree
root | of the tree | |
[in] | element | the element to be deleted from the tree |
int getBalance | ( | node * | root | ) |
int height | ( | node * | root | ) |
inserts a new element into AVL tree
root | of the tree | |
[in] | item | the element to be insterted into the tree |
void levelOrder | ( | node * | root | ) |
prints given tree in the LevelOrder
[in] | root | of the tree |
int main | ( | void | ) |
Main function.
root | of the tree |