Блог пользователя Ashik53

Автор Ashik53, история, 7 лет назад, По-английски

for below input,but my dijkstra code shows wrong output for this input.

5 6

1 2 1

2 3 1

3 4 7

1 5 1

5 4 3

1 4 1

Enter source and destination

1 3

output = 101, should be 2

I found that my code isn't adding the new neighbor nodes in if block of dijkstra function sometimes.So, that's why some nodes are not updated. Why does this happen? I tried multiples times to find out the reason but failed.

My code — https://ideone.com/J7JNxy

Полный текст и комментарии »

  • Проголосовать: нравится
  • -21
  • Проголосовать: не нравится

Автор Ashik53, история, 8 лет назад, По-английски

Hello .. I wanna be good at data structure and graph.. Before switching on this topic , I need some advice from the experienced programmers... Please give me some guidelines about this topic.. How to be good at these topic step by step?

Полный текст и комментарии »

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

Автор Ashik53, история, 8 лет назад, По-английски

I tried with more than 100 inputs and my program gave right output...Yet I can not find any bug :) PLease give me some critical cases :( ... My code will look horrible ..sorry for that :(

my code — http://pastebin.com/cXfF9nXA

problem link — http://www.lightoj.com/volume_showproblem.php?problem=1396

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится