next | previous | forward | backward | up | top | index | toc | Macaulay2 website
PriorityQueue > insert(PriorityQueue,Thing)

insert(PriorityQueue,Thing) -- insert a new element into the queue

Synopsis

Description

i1 : Q = priorityQueue {1,2,3}

o1 = PriorityQueue{...4...}

o1 : PriorityQueue
i2 : insert(Q,0)

o2 = PriorityQueue{...4...}

o2 : PriorityQueue
i3 : insert(Q,4)

o3 = PriorityQueue{...4...}

o3 : PriorityQueue
i4 : min Q

o4 = 0

Caveat

The priority queue Q is mutable and is altered by insert. Q is also the output of the function.