diff --git a/docs/src/priority-queue.md b/docs/src/priority-queue.md index 45083a381..2aec415c7 100644 --- a/docs/src/priority-queue.md +++ b/docs/src/priority-queue.md @@ -8,8 +8,8 @@ efficiently. Usage: ```julia -PriorityQueue(K, V) # construct a new priority queue with keys of type K and priorities of type V -PriorityQueue(K, V, ord) # construct a new priority queue with the given types and ordering +PriorityQueue{K, V}() # construct a new priority queue with keys of type K and priorities of type V (forward ordering by default) +PriorityQueue{K, V}(ord) # construct a new priority queue with the given types and ordering ord (Base.Order.Forward or Base.Order.Reverse) enqueue!(pq, k, v) # insert the key k into pq with priority v enqueue!(pq, k=>v) # (same, using Pairs) dequeue!(pq) # remove and return the lowest priority key diff --git a/src/priorityqueue.jl b/src/priorityqueue.jl index c802356c8..dedc8b324 100644 --- a/src/priorityqueue.jl +++ b/src/priorityqueue.jl @@ -4,7 +4,7 @@ # ------------- """ - PriorityQueue(K, V, [ord]) + PriorityQueue{K, V}([ord]) Construct a new [`PriorityQueue`](@ref), with keys of type `K` and values/priorites of type `V`.