/find-shotest-path-priority-queue-structure-

Implement the given methods of priority queue structure using node structure and pointers a) Create node structure that can store strings b) Create PQueue class, declare data members as discussed and write constructor • Write main method and create a queue object c) Write display method that display the queue each element as DATA | PR. Take care of head & tail(it should not move or any other thing should not change) • Call this method in main to test d) Write add method that accept a string and priority number and place it at proper position. Handle all the cases and minimize the queue traversal. Properly adjust the pointers • Call this method in main to add Lahore | 2, Islamabad | 2, Karachi | 5, Multan | 9 in the queue, and display to confirm e) Write getHigestPriorityNo that accept nothing and return the highest priority value in the queue, if queue is empty than return 9999 • Call this method to check the highest priority in the queue f) Write getHigestPriorityValue that accept nothing and return the highest priority element from the queue, if queue is empty then return empty string • Call this method to check the highest priority element in the queue g) Write remove method that remove element with highest priority and return bool removed if element is removed. Implement the cases as discussed in theory. Properly take care of pointers (both head & tail). • Call this method in main to remove and element and display to confirm h) Write search method that accepts a string and return its position in the queue • Call this method to find Multan i) Write a method getPriority that accept a number and return the priority of element found at that position. If no such element the return 9999 • Call this method to find priority of element at 3rd position j) Write a method getValue that accept a number and return the element at that position. If no such element the return empty string • Call this method to find element at 3rd position k) Write size method that return number of elements in the queue • Call this method to determine queue size l) Implement the destructor of priority queue A tourist is traveling by car and wants to know the shortest path to its destination from a sub graph (see figure). He can’t travel long and have to take rest in between. Show him the path to destination such that he can visit the nearest city to take rest. Consider the cities as separate priority queue and select the local shortest path from each city to lead him to the destination.

Primary LanguageC++MIT LicenseMIT

Watchers