I have to implement a data structure for a IT ticket system which is ordered by priority. So i am going to implement a priority queue. I have both a linkedlist class(and a node class for this) and a min-heap class but not sure which i want to use yet. I also have a main class which basically tests that the data structure works. I then have a request class which holds information about a request:
- String creatorName;
- String problemDescription;
- String ownerName;
- int uniqueID;
- int priorityNo;
What im stuck on is how i link the data in the request class to the data structure class so that it can store it and perform the methods correctly. Any help would be greatly appreciated.
Use the LinkList structure with insertion sort, keep the highest priority at the head or tail, that way each insert will cost you O(n) while finding the min will always cost you O(1), you need to implement comapreTo for each node and you can use it for the sorting.
if you have two classes you can use the request as a decorator for the ticket itself. that way the request will "hold" the ticket.