Shouldn't we use set in dijkstra algorithm instead of priority queue?

Правка en1, от Shivam164, 2022-07-17 17:54:27

As while running Dijkstra's algorithm using a priority queue, we are keeping extra unnecessary nodes in the priority queue which we would not need in the future, but we can remove such nodes while inserting a new node(of the same value) using set.

Теги dijkstra

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский Shivam164 2022-07-17 17:54:27 320 Initial revision (published)