From 41cab4a6ff15c14afcd1f74e2bfe9165beba4770 Mon Sep 17 00:00:00 2001 From: scls19fr Date: Mon, 30 Jul 2018 02:48:55 +0200 Subject: [PATCH] Fix PriorityQueue construction doc and docstring (#406) * Update priority-queue.md Closes #340 * Update priorityqueue.jl --- docs/src/priority-queue.md | 4 ++-- src/priorityqueue.jl | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) 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`.