|
simson Beginner
Joined: 18 Oct 2000 Posts: 29 Location: Sweden
|
Posted: Thu Mar 23, 2006 1:01 pm
Feature Request - priority queues |
I couldn't find much but the zmud script for priority queues when I searched about it here, but having a built in priority queue that accepts any element with any key would be quite useful.
|
|
|
|
MattLofton GURU
Joined: 23 Dec 2000 Posts: 4834 Location: USA
|
Posted: Thu Mar 23, 2006 11:28 pm |
#PRIORITY {}
It's all we need. |
|
_________________ EDIT: I didn't like my old signature |
|
|
|
simson Beginner
Joined: 18 Oct 2000 Posts: 29 Location: Sweden
|
Posted: Thu Mar 23, 2006 11:41 pm |
According to the help file, that is not even remotely close to what I asked for.
|
|
|
|
nexela Wizard
Joined: 15 Jan 2002 Posts: 1644 Location: USA
|
Posted: Fri Mar 24, 2006 12:41 am |
Well then explain what you want
|
|
|
|
simson Beginner
Joined: 18 Oct 2000 Posts: 29 Location: Sweden
|
Posted: Fri Mar 24, 2006 1:06 am |
I want a priority queue. It is a data structure. I want to insert elements with a key into a set and then be able to take out the element with the maximum (or minimum, doesn't really matter) key.
|
|
|
|
Vijilante SubAdmin
Joined: 18 Nov 2001 Posts: 5182
|
Posted: Fri Mar 24, 2006 2:30 am |
Priority queues tend to be specialized to the exact task you want to preform. While I have written one and posted it into the Finished Scripts forum, and tried to make it as generalized as possible; it obviously can not fit every need. Zugg could spend a long time trying to generate something even more general, yet still more functional then the basic #ADDITEM %sort combo. In the end it is simpler to be done with user specific needs in the first place, by a script.
|
|
_________________ The only good questions are the ones we have never answered before.
Search the Forums |
|
|
|
Rainchild Wizard
Joined: 10 Oct 2000 Posts: 1551 Location: Australia
|
Posted: Fri Mar 24, 2006 2:40 am |
Making a generic one shouldn't be too hard for Zugg, you just have the queue have 'item' and 'priority' and a custom comparer user-defined function which return -1, 0, or 1 depending on where to insert it.
|
|
|
|
|
|