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 02:40
Respecting individual differencespre-test active2time remaining48: 47nina is exploring her gender identity and sexual orientationwhich best describes how the role of the media might influence nina during this time in her life? the media would her decide because television shows are always unbiased about gender issues and do notstereotypethe media could make things difficult for her because television sometimes portrays rigid ideas about gender roles.all forms of media will her decide because the media always portrays rigid ideas about gender roles.all forms of media will make things easy for her because the media always portrays open and fair ideas about gender roles.
Answers: 1
question
Computers and Technology, 22.06.2019 06:30
This technology is used to produce high-quality documents that look good on the computer screen and in print.
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
Businesses allocate resources for their best and most productive uses. the more a resource, the more costly it will be. a manufacturer that requires scarce and costly resources is likely to charge for its products.
Answers: 2
question
Computers and Technology, 22.06.2019 12:50
You have just been hired as an information security engineer for a large, multi-international corporation. unfortunately, your company has suffered multiple security breaches that have threatened customers' trust in the fact that their confidential data and financial assets are private and secured. credit-card information was compromised by an attack that infiltrated the network through a vulnerable wireless connection within the organization. the other breach was an inside job where personal data was stolen because of weak access-control policies within the organization that allowed an unauthorized individual access to valuable data. your job is to develop a risk-management policy that addresses the two security breaches and how to mitigate these risks.requirementswrite a brief description of the case study. it requires two to three pages, based upon the apa style of writing. use transition words; a thesis statement; an introduction, body, and conclusion; and a reference page with at least two references. use a double-spaced, arial font, size 12.
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
History, 04.07.2019 22:30
question
Computers and Technology, 04.07.2019 22:30
question
Mathematics, 04.07.2019 22:30
Questions on the website: 13722360