How to create a priority queue with a certain type of key and priority?

mutable struct Event
     time::Float64
     Event = new(-1.0)
end

create a priority queue with keys of type Event and priorities of type Float64

pq = PriorityQueue(Event, Float64)

Then, I got the following error.
"MethodError: no method matching PriorityQueue(::Type{Event}, ::Type{Float64})

Could anyone help out with this code?

Something like this?

using DataStructures

mutable struct Event
     time::Float64
end

pq = PriorityQueue{Event, Float64}()
2 Likes