Sayonara Player
|
#include <Tree.h>
The Tree class.
Public Member Functions | |
Tree (const T &data_) | |
Tree constructor. More... | |
Tree * | copy () |
Tree * | add_child (Tree *node) |
adds a child to the given node More... | |
Tree * | remove_child (Tree *deleted_node) |
remove a node from the current node More... | |
void | move (Tree *new_parent) |
move current node to a new parent More... | |
void | sort (bool recursive) |
sort children of all nodes in ascending way according to their data More... | |
void | print (int lvl) const |
Public Attributes | |
Tree * | parent =nullptr |
QList< Tree * > | children |
T | data |
Tree constructor.
data_ | set the root element |
adds a child to the given node
node | the parent node |
copy the entire tree. Has to be deleted afterwards
move current node to a new parent
new_parent | new parent of node |
remove a node from the current node
deleted_node | node to remove |
|
inline |
sort children of all nodes in ascending way according to their data
recursive | if set to true, do it for all subnodes, too |