Question: Can someone help me with this in C + + I need help implementing the functions below. The attached photos are the . h files

Can someone help me with this in C++
I need help implementing the functions below. The attached photos are the .h files that are the declations for the other .h files below:
Below is heap.h
#ifndef HEAP_H
#define HEAP_H
#include
#include
inline constexpr size_t heap_left(size_t node){
// XXX You must implement this.
return 999;
}
inline constexpr size_t heap_right(size_t node){
// XXX You must implement this.
return 999;
}
inline constexpr size_t heap_parent(size_t node){
// XXX You must implement this.
return 999;
}
template
void heap_preorder(ArrayLike heapdata, size_t heapnodes, size_t node, FN fn){
// XXX You must implement this.
}
template
void heap_inorder(ArrayLike heapdata, size_t heapnodes, size_t node, FN fn){
// XXX You must implement this.
}
template
void heap_postorder(ArrayLike heapdata, size_t heapnodes, size_t node, FN fn){
// XXX You must implement this.
}
template
void heap_levelorder(ArrayLike& heapdata, size_t heapnodes, FN fn){
// XXX You must implement this.
}
// min tree uses less than, so compare(parent, child) should be true
template
bool is_heap(const ArrayLike& heapdata, size_t nodes, COMPARISON compare){
// XXX You must implement this properly.
return false;
}
template
size_t heap_bubble_up(RAIterator begin, size_t nodes, size_t start, COMPARE compare){
// XXX You must implement this properly.
return 9999999;
}
template
size_t heap_bubble_down(RAIterator begin, size_t nodes, size_t start, COMPARE compare){
// XXX You must implement this properly.
return 9999999;
}
template
void heap_insert(CONTAINER& heapdata, size_t& nodes, T key, COMPARISON compare){
// XXX You must implement this properly.
}
template
auto heap_extract(CONTAINER& heapdata, size_t& nodes, COMPARISON compare){
// XXX You must implement this properly.
return heapdata[9999999];
}
template
size_t heapify_in_place_up(RAIterator begin, RAIterator end, COMPARE compare){
// XXX You must implement this properly.
return 9999999;
}
template
size_t heapify_in_place_down(RAIterator begin, RAIterator end, COMPARE compare){
// XXX You must implement this properly.
return 9999999;
}
template
void heap_sort(RAIterator begin, RAIterator end, COMPARE compare){
// XXX You must implement this properly.
}
#endif
Below is heap_priority_queue.h
#ifndef HEAP_PQ_H
#define HEAP_PQ_H
#include "heap_priority_queue.decl.h"
template
template
heap_priority_queue::heap_priority_queue(ITERATOR begin, ITERATOR end){
// XXX this must be implemented properly.
}
template
T& heap_priority_queue::top(){
// XXX this must be implemented properly.
static T x; return x; // intentionally wrong, but will compile
}
template
bool heap_priority_queue::empty() const {
// XXX this must be implemented properly.
return true;
}
template
size_t heap_priority_queue::size() const {
// XXX this must be implemented properly.
return 999999; // intentionally wrong
}
template
void heap_priority_queue::push(const T& x){
// XXX this must be implemented properly.
}
template
void heap_priority_queue::pop(){
// XXX this must be implemented properly.
}
// This one is provided for you and does not need changes.
template
void heap_priority_queue::dump_data(std::ostream& ost) const {
ost "[";
for (size_t i =0; i nodes; ++i){
ost data[i]"";
}
ost "]";
}
#endif
Can someone help me with this in C + + I need

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!