wu :: forums
« wu :: forums - Priority Queue Operations »

Welcome, Guest. Please Login or Register.
Apr 24th, 2024, 11:29pm

RIDDLES SITE WRITE MATH! Home Home Help Help Search Search Members Members Login Login Register Register
   wu :: forums
   riddles
   cs
(Moderators: SMQ, Grimbal, ThudnBlunder, william wu, Eigenray, towr, Icarus)
   Priority Queue Operations
« Previous topic | Next topic »
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print
   Author  Topic: Priority Queue Operations  (Read 1248 times)
Barukh
Uberpuzzler
*****






   


Gender: male
Posts: 2276
Priority Queue Operations  
« on: Jul 6th, 2014, 11:10am »
Quote Quote Modify Modify

Many literature sources on Priority Queues list the following set of operations: Insert, Minimum, Extract-Minimum, Decrease-Key, Delete (see, e.g. Cormen, Leiserson, Rivest book on Algorithms).
 
Note that Increase-Key is not included in this set. Why is this? Is it because the operation is rather unusual, or there is no more efficient implementation than just Delete/Change-Key/Insert?
IP Logged
rloginunix
Uberpuzzler
*****





   


Posts: 1029
Re: Priority Queue Operations  
« Reply #1 on: Jul 6th, 2014, 12:10pm »
Quote Quote Modify Modify

1). I don't think that operation is unusual. It happens in real life all the time. My work load is a priority queue. When a previously lower priority item becomes "hot" all of a sudden my manager will tell me "stop doing what you are doing and do this instead". Apply this to many team members, teams, departments ...
 
2). In practice I deal with multi-thread-safe containers only. So I'd rather have that operation - you need to lock/unlock only once vs. twice for the Delete/Change/Insert. Not to mention the data consistency issues.
IP Logged
Pages: 1  Reply Reply Notify of replies Notify of replies Send Topic Send Topic Print Print

« Previous topic | Next topic »

Powered by YaBB 1 Gold - SP 1.4!
Forum software copyright © 2000-2004 Yet another Bulletin Board