aslf010990's blog

By aslf010990, 10 years ago, In English

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

  • Vote: I like it
  • +2
  • Vote: I do not like it

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

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.

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

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

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

      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.

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

Problem from timus.