I have a college programming project in C ++ divided into two parts. I begin the second part where it is supposed to use priority_queues , hash tables and BST .
I am having problems (at least) with priority queues, since it obliges me to redo a lot of code already implemented in the first part.
The project is about introducing a simple airport management system and, therefore, I have classes such as airport (main class), plane, terminal and flight. My airport had list terminals, but now the project specification indicates that I should support the terminals in priority_queue , where the top of the terminal is less busy, i.e. has fewer flights.
For each class I have CRUD functions, but now, as I suppose, for example, edit the terminal and add a flight to it? With the list, I just had to move to a certain position, but now I only have access to the object at the top of the queue. The solution I was thinking about was copying the priority queue terminals to a temporary list, but to be honest, I don't like this approach.
What should I do?
Thanks in advance.
c ++ iterator list priority-queue
Renato rodrigues
source share