#include <scapegoat_tree.hpp>
|
| TreeNode * | findTraitor (TreeNode *node) |
| |
| TreeNode * | rebuildTree (int start, int end, TreeNode *parent_node, T *array) |
| |
| void | inorderTraversal (const TreeNode *node, int &i, T *&array) const |
| |
| void | preorderTraversal (const TreeNode *node) |
| |
| void | displayPreOrder (const TreeNode *node, std::ostream &os) |
| |
| void | displayInOrder (const TreeNode *node, std::ostream &os) |
| |
| void | displayPostOrder (const TreeNode *node, std::ostream &os) |
| |
| int | getThreshold () const |
| |
| void | DeletionRebuild () |
| |
| bool | areTreesEqual (const TreeNode *n1, const TreeNode *n2) const |
| |
| void | restructure_subtree (TreeNode *newNode) |
| |
| T | sumHelper (TreeNode *node, T min, T max) |
| |
| void | rangeHelper (TreeNode *node, T min, T max, Vector< T > &range) |
| |
| T | kthSmallestHelper (TreeNode *node, int k) const |
| |
◆ TreeNode
◆ ScapeGoatTree() [1/4]
Default constructor for an empty Scapegoat Tree.
◆ ScapeGoatTree() [2/4]
◆ ScapeGoatTree() [3/4]
◆ ScapeGoatTree() [4/4]
Move constructor for transferring ownership from another ScapeGoatTree.
◆ ~ScapeGoatTree()
Destructor that cleans up all nodes in the tree.
◆ areTreesEqual()
Compares two subtrees for structural and value equality.
◆ begin()
◆ changeAlpha()
◆ clear()
Removes all nodes from the tree and resets its state.
◆ countN()
Counts the total number of nodes in the subtree rooted at the given node.
◆ deleteBatch()
Removes multiple values from a Vector from the tree.
◆ deleteValue()
Removes a value from the tree and maintains balance if needed.
◆ DeletionRebuild()
Checks if a rebuild is needed after a deletion and performs it if necessary.
◆ displayInOrder() [1/2]
Returns a string representing the tree in in-order traversal.
◆ displayInOrder() [2/2]
Formats the tree in in-order.
◆ displayLevels()
Returns a string representing the tree in level-order traversal.
◆ displayPostOrder() [1/2]
Returns a string representing the tree in post-order traversal.
◆ displayPostOrder() [2/2]
Formats the tree in post-order.
◆ displayPreOrder() [1/2]
Returns a string representing the tree in pre-order traversal.
◆ displayPreOrder() [2/2]
Formats the tree in pre-order.
◆ end()
◆ find_node()
◆ findH()
Calculates the height of a given node in the tree.
◆ findSuccessor()
◆ findTraitor()
Finds the highest node that violates the alpha-weight-balance property.
◆ getMax()
◆ getMin()
◆ getRoot()
Returns a pointer to the root node of the tree.
◆ getSuccessor()
◆ getThreshold()
Calculates the maximum allowed height before a rebuild is triggered.
◆ inorderTraversal()
Performs an in-order traversal to populate a sorted array with node values.
◆ insert()
Inserts a new value into the tree and maintains balance if needed.
◆ insertBatch()
Inserts multiple values from a Vector into the tree.
◆ isBalanced()
Returns a string report indicating if the tree is currently balanced.
◆ kthSmallest()
◆ kthSmallestHelper()
◆ operator!()
Checks if the tree is empty.
◆ operator!=()
Checks if two trees are not equal.
◆ operator+() [1/2]
Creates a new tree containing elements from both trees.
Creates a new tree containing elements from both trees using linear merge.
if first is smaller then take it and increment the indicies for the merged list and the current array else if second is smaller then take it and increment the indicies for the merged list and the current array else (duplicates) take one of them and skip the duplicate in the other array
◆ operator+() [2/2]
Overloaded plus operator for inserting a value.
◆ operator+=()
Overloaded addition assignment operator for inserting a value.
◆ operator-()
Overloaded minus operator for deleting a value.
◆ operator-=()
Overloaded subtraction assignment operator for deleting a value.
◆ operator=() [1/3]
Assignment operator for deep copying.
Assignment operator for deep copying another tree.
◆ operator=() [2/3]
Clears the current tree and initializes it with a single value.
Clears the current tree if the assigned value is 0.
◆ operator=() [3/3]
Move assignment operator.
Move assignment operator for transferring ownership.
◆ operator==()
Checks if two trees are equal.
Checks if two trees are equal by comparing their structures and values.
◆ operator[]()
Overloaded subscript operator to search for a value in the tree.
◆ postorderTraversal()
Recursively deletes all nodes in the subtree using post-order traversal.
◆ preorderTraversal()
Performs a pre-order traversal for internal processing.
◆ rangeHelper()
◆ rebuildTree()
Recursively rebuilds a balanced BST from a sorted array of values.
◆ redo()
Redo the last undone operation. If the last undone operation was a batch, it redoes the entire batch.
◆ restructure_subtree()
Initiates a subtree rebuild starting from the scapegoat node.
◆ search()
Searches for a specific value in the tree.
◆ split()
◆ sumHelper()
◆ sumInRange()
◆ undo()
Undo the last operation (insert or delete). If the last operation was a batch, it undoes the entire batch.
◆ updateSize()
◆ valuesInRange()
◆ ALPHA
◆ isUndoing
Flag to prevent operations triggered by undo/redo from being recorded. This avoids infinite recursion and keeps the undo history clean.
◆ max_nodes
◆ nNodes
◆ rebuildCount
◆ redoStack
Stack to store commands that have been undone and can be redone.
◆ root
◆ undoStack
Stack to store commands that can be undone.
The documentation for this class was generated from the following files: