You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to
Hi,
I created a PriorityQueue by using this command.
>>P = java.util.PriorityQueue;
But there is a problem when adding elements. I can only add the first element.
The command I used was
>>P.add({1,1});
When i try to add more i get the below error
-----------------------------------------------------------------------------
??? Java exception occurred:
java.lang.ClassCastException:
[Ljava.lang.Object; cannot be cast to
java.lang.Comparable
at
java.util.PriorityQueue.siftUpComparable(Unknown Source)
at java.util.PriorityQueue.siftUp(Unknown Source)
at java.util.PriorityQueue.offer(Unknown Source)
at java.util.PriorityQueue.add(Unknown Source)
------------------------------------------------------------------------------