Question: Please help me to get a head start on coding in C++. Thanks. Ordered Priority Que (cpp file, that I need help with) should be

Please help me to get a head start on coding in C++. Thanks.

Ordered Priority Que (cpp file, that I need help with) should be implemented by calling methods from the OrderedArrayList.cpp (provided below).

Priority Queue. For this ADT, removal operations always return the object in the queue of highest priority that has been in the queue the longest. That is, no object of a given priority is ever removed as long as the queue contains one or more object of a higher priority. Within a given priority First-In-First-Out (FIFO) order must be preserved.

AbstractList.h (header file, the declaration for Abstract list).

Please help me to get a head start on coding in C++.

Thanks. Ordered Priority Que (cpp file, that I need help with) should

OrderedArrayList.h, class prototype defined in OrderedArrayList.h. A subclass of the pure virtual AbstractList class defined in its header file.

be implemented by calling methods from the OrderedArrayList.cpp (provided below). Priority Queue.

OrderedArrayList.cpp, The implementation.

For this ADT, removal operations always return the object in the queue

of highest priority that has been in the queue the longest. Thatis, no object of a given priority is ever removed as long

as the queue contains one or more object of a higher priority.

PriorityQueue.h, (header file, the declaration for Priority Queue.)

Within a given priority First-In-First-Out (FIFO) order must be preserved. AbstractList.h (header

OrderedPQ.h, (Ordered priority queue, A class prototype defined in OrderedPQ.h. A subclass of the pure virtual PriorityQueue class defined in its header file)

file, the declaration for Abstract list). OrderedArrayList.h, class prototype defined in OrderedArrayList.h.

I need help with writing C++ code for OrderedPQ.cpp - implementation for Ordered Priority Queue. Write code for the required public functions in OrderedPQ.h.

This should be implemented by calling the methods from OrderedArrayList.cpp list class - (provided). Please show explanations/comments for the answers, so I will learn. Thanks.

class OrderedArraylist : public Abstractlist \{ private: int* array; int capacity; int currentPos; public: OrderedArraylist(); OrderedArrayList(int initialCapacity); virtual bool add(int data); virtual bool add(int index, int data); virtual void clear(); virtual bool contains(int data); virtual int get(int index); virtual int index0f(int data); virtual bool isEmpty(); virtual int remove(int index); virtual bool removeAll(int data); virtual int size(); virtual void trimToSize(); \}; \#endif \} void OrderedArraylist: :trimToSize() \{ int *tmp = new int[currentSize]; capacity=currentSize;for(inti=0;i

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 Databases Questions!