Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with getting this code to print using c++ I want to see the output #ifndef PRIORITYLIST_H_ #define PRIORITYLIST_H_ #include #include #include template

I need help with getting this code to print using c++ I want to see the output

#ifndef PRIORITYLIST_H_ #define PRIORITYLIST_H_

#include #include #include

template class PriorityList {

private: std::vector elements; int n; // number of elements in vector

public: // Construct an empty PriorityList with the capacity to store 20 elements PriorityList() {

}

// Return the number of elements currently in this PriorityList int size() {

}

// Return true if size() == 0 or false if size() > 0 bool isEmpty() {

}

// Insert the element at the given index. // precondition: index is on the range of 0 through size() void insertElementAt(int index, E el) {

}

// Return a reference to the element at the given index. // precondition: index is on the range of 0 through size()-1 E getElementAt(int index) {

}

// Remove the element at the given index. // precondition: index is on the range of 0 through size()-1 void removeElementAt(int index) { }

// Swap the element located at index with the element at index+1. // An attempt to lower the priority of the element at index size()-1 has no effect. // precondition: index is on the range of 0 through size() void lowerPriorityOf(int index) {

}

// Swap the element located at index with the element at index-1. // An attempt to raise the priority at index 0 has no effect. // precondition: index is on the range of 0 through size() void raisePriorityOf(int index) { }

// Move the element at the given index to the end of this list. // An attempt to move the last element to the last has no effect. // precondition: index is on the range of 0 through size()-1 void moveToLast(int index) { }

// Move the element at the given index to the front of this list. // An attempt to move the top element to the top has no effect. // precondition: index is on the range of 0 through size()-1 void moveToTop(int index) {

}

};

#endif /* PRIORITYLIST_H_ */

Output:

Student Name, CIS127, Activity 11.2 - 11D Insert elements a, b, c, d: a b c d Insert element f: a f b c d Remove first element: f b c d Lower element f: b c d f Raise element d: d b c f Make element d last: b c f d Make element f first: f b c d

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

3. What are the current trends in computer hardware platforms?

Answered: 1 week ago