Please help my C++ assignment. Anyone help me please. #include #include #include #include

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Please help my C++ assignment. Anyone help me please. #include #include #include #include

Post by answerhappygod »

Please help my C++ assignment. Anyone help me please.
#include <iostream>
#include <queue>
#include <vector>
#include <string>
#include <fstream>
using namespace std;
template <typename Type>
class priorityQ
{
public:

void
insert(const Type &);
void
deleteHighestPriority ();

private:
int
capacity; //the length of heapArray
int items;
// the amount of item store to the heap
Type *
heapArray; // array contains the element for queue
};
• void priorityQ::insert(const Type& element) - inserts
element to the end of the heap and bubbles the element up, resizes
if needed, also increments items counter by 1
template <typename Type>
void priorityQ<Type>::insert(const Type& element)
{
//Please help this one
}
• void priorityQ::deleteHighestPriority() - removes the root
element by assigning the root with the end element in the heap and
bubbles the element down, also decrements items by 1 (does nothing
if the heap is empty)
template <typename Type>
void priorityQ<Type>::deleteHighestPriority()
{
// Please help this one too.
}
Thank you in advanced! Please ......................... I must
give you thumb up if you did a correct solution.
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply