Maple Professional
Maple Academic
Maple Student Edition
Maple Personal Edition
Maple Player
Maple Player for iPad
MapleSim Professional
MapleSim Academic
Maple T.A. - Testing & Assessment
Maple T.A. MAA Placement Test Suite
Möbius - Online Courseware
Machine Design / Industrial Automation
Aerospace
Vehicle Engineering
Robotics
Power Industries
System Simulation and Analysis
Model development for HIL
Plant Modeling for Control Design
Robotics/Motion Control/Mechatronics
Other Application Areas
Mathematics Education
Engineering Education
High Schools & Two-Year Colleges
Testing & Assessment
Students
Financial Modeling
Operations Research
High Performance Computing
Physics
Live Webinars
Recorded Webinars
Upcoming Events
MaplePrimes
Maplesoft Blog
Maplesoft Membership
Maple Ambassador Program
MapleCloud
Technical Whitepapers
E-Mail Newsletters
Maple Books
Math Matters
Application Center
MapleSim Model Gallery
User Case Studies
Exploring Engineering Fundamentals
Teaching Concepts with Maple
Maplesoft Welcome Center
Teacher Resource Center
Student Help Center
priqueue - priority queue functions
Calling Sequence
priqueue[initialize](pq)
priqueue[insert](NewRecord, pq)
priqueue[extract](pq)
Parameters
pq
-
name of the priority queue
NewRecord
structure to be inserted in the queue
Description
The initialize function makes the necessary assignments (side effects) so that the queue pq is initialized with an empty queue. The queue pq is treated as an unbounded array of the inserted records. Additionally, pq maintains the number of entries in the queue.
The insert function adds an element to the queue. The queue is a maximum queue, that is, the maximum element is kept on the head of the queue. The criteria for ordering the queue is giving by NewRecord and hence this value should exist and be comparable.
The extract function returns the stored record with the highest value (in its first position) and deletes this record from the queue.
Multiple priority queues are allowed.
If inspection alone is desired, the maximum element of the queue is always at pq.
To use a priqueue function, either define that specific function alone by the command with(priqueue,function), or define all priqueue functions by the command with(priqueue).
Examples
See Also
heap, queue, stack
Download Help Document