Leetcode 1514. Path with Maximum Probability

preview_player
Показать описание
Рекомендации по теме
Комментарии
Автор

Was this question asked in companies that you have shown in your thumbnail??

parimal
Автор

Bro this time you were just reciting the code you were writing, please try to explain the intuition too

Sunny-riyo
Автор

Based on what you said at12:00, "instead of minimizing the distance we are maximising it", so is it like we are trying to find the longest path? And if this is the case, then I have a doubt that how can we find the longest simple path if there are positive cycles in the graph using dijkstra's algorithm. Can you please explain.

utsavkumartiwari
Автор

Bro 1 doubt..
In case of shortest path we use min priority queue but now in this case (longest path) shouldn't we use max priority queue so that for each node we can select the child which has max probability?

shomilmaurya
welcome to shbcf.ru