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, 23.06.2019 11:00
This chapter lists many ways in which becoming computer literate is beneficial. think about what your life will be like once you’re started in your career. what areas of computing will be most important for you to understand? how would an understanding of computer hardware and software you in working from home, working with groups in other countries and contributing your talents.
Answers: 1
question
Computers and Technology, 23.06.2019 23:30
What are "open-loop" and "closed-loop" systems
Answers: 1
question
Computers and Technology, 24.06.2019 04:30
1. web and mobile applications allow users to be actively engaged in an online activity. a true b false 2. some examples of business applications purposes are to collaborate, share files, meet virtually in real-time, and accept payments. a true b false 3. an education application would most likely do which of the following? a allow users to watch popular movies and tv shows b connect users with social and business contacts c confirm users' travel plans d teach users a new language 4. a uniform resource locator (url) is how the internet knows where to take users when an address is typed into a browser. a true b false 5. deon is required to provide the citation information for his sources. what type of information should he collect from his sources? a author name, title, date of publication, date of access, url b connections to background information c interesting facts and statistics d notes on important information
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Which of the statements below describe the guidelines for the use of text in presentation programs? a. do not use numbered lists. b. fonts should be appropriate for your audience. c. limit the number of fonts you use to three or four. d. only use bulleted lists for sales promotions. e. select font sizes that are appropriate for your delivery method. f. use font colors that work well with your background. select all that apply
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
Mathematics, 20.10.2020 16:01
question
Business, 20.10.2020 16:01
question
Biology, 20.10.2020 16:01