subject

Use the definition and the code for the heap developed in class and add the member function int heapRemove ()to the Heap class. The heapRemove() returns the value of the root and readjust the heap to maintain the heap property. [Hint: heapRemove() uses percolate down function] #include
#include
using namespace std;
// The Node class for the Binary Search Tree
template
class Node
{
public:
Node();
Node(T e, Node* r, Node* l);
T element; // holds the node element
Node* right;
Node* left;
};
// implementation of the constrcutors of the Node
template
Node::Node() { right = left = NULL; }
template
Node::Node(T e, Node* r, Node* l) { element = e; right = r; left = l; }
// Binart Searct Tree (BST) class
template
class BTree
{
public:
BTree() { root = NULL; }
BTree(Node* rt) { root = rt; }
void BSTInsert(T value);
void BSTRemove(T value);
Node*& getRoot() { return root; } // returns the pointer to the root
Node* BSTsearch(T value);
private:
Node* root; // a pointer to the root of the tree
};

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 12:40
The most complicated four letter word
Answers: 1
question
Computers and Technology, 23.06.2019 07:50
Most shops require the technician to enter a starting and ending time on the repair order to track the actual time the vehicle was in the shop and closed out by the office. this time is referred to as _ time ? a. comeback b. ro c. cycle d. lead
Answers: 1
question
Computers and Technology, 23.06.2019 17:00
The more powerful, 60 volt cables and the main power shut-off on an hev are both colored orange.
Answers: 1
question
Computers and Technology, 23.06.2019 21:30
Enzo’s balance sheet for the month of july is shown. enzo’s balance sheet (july 2013) assets liabilities cash $600 credit card $4,000 investments $500 student loan $2,500 house $120,000 mortgage $80,000 car $6,000 car loan $2,000 total $127,100 total $88,500 which expression finds enzo’s net worth?
Answers: 1
You know the right answer?
Use the definition and the code for the heap developed in class and add the member function int heap...
Questions
question
English, 05.12.2019 16:31
question
English, 05.12.2019 16:31
Questions on the website: 13722362