Please fill in the CODE HERE parts #ifndef AVLTREE_H #define AVLTREE_H #include “Data.h” template cl

FIRST GRADER essay writing company is the ideal place for homework help. If you are looking for affordable, custom-written, high-quality and non-plagiarized papers, your student life just became easier with us. Click the button below to place your order.


Order a Similar Paper Order a Different Paper

Please fill in the CODE HERE parts #ifndef AVLTREE_H #define AVLTREE_H #include “Data.h” template class AVLTree { private:    struct AVLNode {        AVLNode* leftChild;        AVLNode* rightChild;        T* data;        int duplicates; // used if thereare duplicate values in the tree            // instead ofchanging rotation rules        int height;        AVLNode () :   //default constructor            leftChild{nullptr},            rightChild{nullptr},            data{nullptr},            duplicates{0},            height {0}{};        ~AVLNode () = default;        AVLNode (T& value) :            leftChild{nullptr},            rightChild{nullptr},            duplicates{0},            height {0}{               data = new T{value};            };        AVLNode (T&& value):            leftChild{nullptr},            rightChild{nullptr},            duplicates{0},            height {0}{               data = new T{value};            }        AVLNode (T& value, AVLNode*left, AVLNode* right) :            leftChild{left},            rightChild{right},            duplicates{0},            height {0}{               data = new T{value};            };        AVLNode (T&& value,AVLNode* left, AVLNode* right) :            leftChild{left},            rightChild{right},            duplicates{0},            height {0}{               data = new T{value};            }    };    AVLNode* root; // mutators————————————————————    // inserts a new value into the given subtree withnode as the root.    // If the value already exists, just incrememnt theduplicates counter.    // Else, create memory for it and place pointersappropriately.    // Must use recursion.    void insert(T& value, AVLNode* & node){        // CODE HERE    }    // will balance the tree with node as the offendingroot, like    // alpha in our class discussions. Should call onfof the rotate functions.    // Don’t forget to set the height at the end!    void balance(AVLNode* & node){        // CODE HERE    }    // Rotate binary tree node with left child, i.e. asingle rotation    // for case 1. Update the heights, and set newroot.    void rotateLeft(AVLNode*& node){        // CODE HERE    }    // Rotate binary tree node with right child, i.e. asingle rotation    // for case 4. Update the heights, and set newroot.    void rotateRight(AVLNode*& node){        // CODE HERE    }    // Double rotate binary tree node: first left childwith its right    // child, then subroot with its new left child (wasgrandchild previously).    // I.e. rotation case 2. Update the heights, andset new root.    void rotateDoubleLeft(AVLNode*& node){        // CODE HERE    }    // Double rotate binary tree node: first left childwith its right    // child, then subroot with its new left child (wasgrandchild previously).    // I.e. rotation case 2. Update the heights, andset new root.    void rotateDoubleRight(AVLNode*& node){        // CODE HERE    }    // removes a given value from the tree. If the Nodecontaining the value    // has duplicates, decrement the duplicates. Elsedeallocate the memory and    // recursively call remove to fix the tree, asdiscussed in class.    void remove(T& value, AVLNode*& node){        // CODE HERE    }    // private function to recursively empty    void empty(AVLNode* node){        // CODE HERE    } //Data.h——————————— #ifndef DATA_H #define DATA_H #include class DoubleData { private: double* data; public: DoubleData(); DoubleData(double a); ~DoubleData() = default; // accessors ——————————- double getData() const ; double compare(DoubleData& other) const; friend std::ostream& operator . . .

Got stuck with another paper? We can help! Use our paper writing service to score better grades and meet your deadlines.

Get 15% discount for your first order


Order a Similar Paper Order a Different Paper
Writerbay.net