Talk:Priority queue: Difference between revisions

From Rosetta Code
Content added Content deleted
(Refinement)
 
(→‎Refinement: Hmm, not sure)
Line 9: Line 9:
2 Tax return
2 Tax return
This is just a suggestion, but it shows the value of these sorts of structures. –[[User:Dkf|Donal Fellows]] 08:09, 4 August 2011 (UTC)
This is just a suggestion, but it shows the value of these sorts of structures. –[[User:Dkf|Donal Fellows]] 08:09, 4 August 2011 (UTC)
: I did put a test case in the draft, the add-then-dequeue sorting thingy, if somewhat vague. I don't know if using a very small sample test case like this is a good idea, since priority queue is often used in performance critical areas like process/IO schedulers, while a small test case tend to encourage inefficient solutions--won't be long before we see someone implement O(n^2) insertion times. Your task priorities are pretty good, though. --[[User:Ledrug|Ledrug]] 08:22, 4 August 2011 (UTC)

Revision as of 08:22, 4 August 2011

Refinement

This draft task needs more work. In particular, it needs something for people to actually do with the priority queue; just instantiating it isn't enough! What about sorting a bunch of tasks? Here's a possible set, sorted alphabetically by task name:

Priority    Task
  3        Clear drains
  4        Feed cat
  5        Make tea
  1        Solve RC tasks
  2        Tax return

This is just a suggestion, but it shows the value of these sorts of structures. –Donal Fellows 08:09, 4 August 2011 (UTC)

I did put a test case in the draft, the add-then-dequeue sorting thingy, if somewhat vague. I don't know if using a very small sample test case like this is a good idea, since priority queue is often used in performance critical areas like process/IO schedulers, while a small test case tend to encourage inefficient solutions--won't be long before we see someone implement O(n^2) insertion times. Your task priorities are pretty good, though. --Ledrug 08:22, 4 August 2011 (UTC)