Priority Queue..

How does Priority Queue work. This is my scenario, I have certain objects with priorities 1,2,..10. There could be multiple objects with same priority. I was thinking I can put them into a priority queue and let the pool() give me the objects with highest priority.. ?
I m kinda confused with PQ.
1) I get errors when i create a PQ <MyClass>.
2) Do i need to use comparator to ensure i check the priority of the object?

Agreed. I inserted elements in PQ..
But things get weird.
1) Create a class called msg with variable "p"
2) I created PQ and Comparator to handle inserts of instances of msg and compare value of "p"
3) Now i insert more than one msg with same "p" (the various p values are 2,1,3,2)
4) For some reason, after i do all the "offers", when i print the pq,
the order i get is 1,2,3,2
5) Now if i do a peek() or pool(), then, the pq gets ordered and i get 1,2,2,3.
Any pointers..?

Hi. so this is actually a continuation from another question of mine[Here](https://www.daniweb.com/programming/software-development/threads/506795/dynamically-add-values-into-datagridview-cell-from-listbox-vb2010) but i was advised to start a new thread as the original question …

I have a 2d matrix with dimension (3, n) called A, I want to calculate the normalization and cross product of two arrays (b,z) (see the code please) for each column (for the first column, then the second one and so on).
the function that I created to find the ...

Write a C program that should create a 10 element array of random integers (0 to 9). The program should total all of the numbers in the odd positions of the array and compare them with the total of the numbers in the even positions of the array and indicate ...