Queues implementation

1. Create a PriorityQueue class and implement a new enqueue ) method to implement a priority queuing discipline. For efficiency, priority queues are often implemented using a heap, so that both insertion and removal of items can be done in O(log n) time. However, we are going to use a simple naive method and simply insert new items into a link list that we keep sorted by priority. Doing this means that the insertion (enqueue ()) operation becomes O(log n), but since for a priority queue we always want the next item with the highest priority for a dequeue), dequeue) is st O(1) constant time, since we will keep items order by priority and the highest priority item in the queue should always be at the front of the list This may sound like a lot, but there is really not too much to do to priority queue working. You need to perform the following steps (a) Create a new c
Last edited on
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#include <iostream>
#include <cctype>
#include <limits>

int main()
{
	std::cout << "Do you want someone to do all the work for you? ";
	char answer {};
	std::cin >> answer;

	std::cin.ignore(std::numeric_limits<std::streamsize>::max(), '\n');

	if (std::toupper(answer) == 'Y' ) { std::cout << "Post it in the Jobs section.\n"; }

	else { std::cout << "Show what have you coded so far.\n"; }

	std::cout << "Good luck.\n";
}


Excellent job of copying and pasting the entirety of your assignment, maybe now you can copy and paste any actual work you've done to complete all those lengthy, verbose and boring assignment requirements?
Topic archived. No new replies allowed.