void insert(Node*& root, int data) { if (!root){ root = new Node(data); } else if (data < root->data){ insert(root->left,
Continue ReadingC++: Binary Search Tree Verification
struct TreeNode { int data; TreeNode *left; TreeNode *right; }; bool isBST(TreeNode *node, int minData, int maxData) { if(node == NULL
Continue ReadingC++: Brownian Tree
Generate and draw a Brownian Tree. A Brownian Tree is generated as a result of an initial seed, followed by the interaction of two processes.
Continue ReadingC++: Cycles in family tree software
I am the developer of some family tree software (written in C++ and Qt). I had no problems until one of my customers mailed me a bug report. The probl
Continue ReadingC++: Fractal Tree
Generate and draw a fractal tree. To draw a fractal tree is simple: Draw the trunk At the end of the trunk, split by some angle and draw tw
Continue ReadingC++: AVL Tree
In computer science, an AVL tree is a self-balancing binary search tree. In an AVL tree, the heights of the two child subtrees of any node differ by a
Continue Reading