Vector stores each string and also stores the string's priority? Can I use two vectors?
PQEntry objects because a PQEntry structure stores a string value and an integer priority.
operator << for printing a priority queue?
It seems like the operator would need access to the private data inside of the priority queue object.
<< operator in our assignment is declared with a special keyword called friend that makes it so that this operator is able to directly access the private data inside the priority queue if needed.
new keyword.
clear method?
Don't they do the same thing, deleting all elements from the queue?
ListNode and ListNode* ? Which one should I use?
ListNode ; you want only ListNode* .
The former is an object, the latter is a pointer to an object.
You always want pointers to ListNode objects in this assignment because objects created with new live longer; they are not cleaned up when the current function exits.
ListNode?
new keyword. Like this:
ListNode* node = new ListNode();
Or, you can pass one or both of the data and next values on construction:
ListNode* node = new ListNode(data, next);
>= =< > < == !=
current->next->data before checking whether current or current->next are NULL.
ArrayList code/slides from lecture to get a good idea.