red_coder's blog

By red_coder, 14 years ago, In English

hey guys here is a simple SPOJ Problem based on Dijikstra Algo. But i am not able to understand why am i getting wrong answer. Here is my CODE. Can somebody tell me where am i getting wrong.

  • Vote: I like it
  • -19
  • Vote: I do not like it

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

lol, maybe you need to use Dijkstra with a priority queue. It can help.

  • »
    »
    14 years ago, hide # ^ |
     
    Vote: I like it 0 Vote: I do not like it

    NO dude, the method i have used is correct, at each step i am trying to find the node with lowest key and then hold it and make it 'marked'.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

you have static arrays and you need to enter a default size.

»
14 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Done finally :)