Macaulay2 » Documentation
Packages » PriorityQueue > pop
next | previous | forward | backward | up | index | toc

pop -- returns the minimum element of the queue and deletes it

Synopsis

Description

pop both returns the minimum element and deletes it from the queue.

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

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

o1 : PriorityQueue
i2 : pop Q

o2 = 1
i3 : pop Q

o3 = 2
i4 : pop Q

o4 = 3
i5 : pop Q

Caveat

Both pop Q and min Q return the same value, but Q is altered by pop.

See also

Ways to use pop :

For the programmer

The object pop is a method function.