I am getting the right answer for the given testcase but I am facing wrong answer error as I submit.
I have taken the GenericHeap code taught to us and have included all the necessary functions ( also UPDATE PRIORITY ) and for those nodes which have cost as -1 are added in the graph but with NO EDGES. For those isolated nodes I have given the condition that
if( value == Integer.MaxValue )
then print -1 for them.
Please tell me if I am missing something in the question.
Wrong answer error
can you please post your code and specific test case(that you are mentioning) here.
Thanks,
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.