You are not logged in. Please login at www.codechef.com to post your questions!

×

DIJSKTRA IMPLEMENTATION USING PRIORITY QUEUE IN C..???

anyone can plzz provide the code as i am unable to figure out,how to implement the queue part??? so that it takes O(lgn) time for insrtion and deletion???

asked 16 Sep '13, 08:47

wonder's gravatar image

2★wonder
361183769
accept rate: 0%


You need to use a data structure called heap, to get the insertions and deletions in the priority queue in O(log n) time

link

answered 16 Sep '13, 08:54

tijoforyou's gravatar image

2★tijoforyou
4.2k52364
accept rate: 15%

can u provide me with the full code?? and also is there any STL in c++??

(16 Sep '13, 09:07) wonder2★
2
(16 Sep '13, 14:15) betlista ♦♦3★
link

answered 16 Sep '13, 16:39

prakhs123's gravatar image

4★prakhs123
33641019
accept rate: 3%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×179

question asked: 16 Sep '13, 08:47

question was seen: 1,121 times

last updated: 16 Sep '13, 16:39