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

Автор aslf010990, 9 лет назад, По-английски

hi all, i am learning priority queues, you can indicate exercises where applied this data struct? thank you.

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

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Learn Djistra or Maximum Spanning Tree(krustal algorithm). These algorithms uses priority queue,because we want the 'less' distance and we need a queue that it is sorted by distance.

  • »
    »
    9 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I think you mean "minimum spanning tree"?? and Kruskal algorithm doesn't uses priority queue ..

    • »
      »
      »
      9 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      That depends on implementation. It's certainly not necessary, since you can just sort the edges and process them in order, but you can use a priority queue if you want.

»
9 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Problem from timus.