Creates a priority_queue from elements in ... and matching
priorities.
Details
Empty construction is supported: priority_queue() returns an empty queue.
If elements are named, names are preserved for name-based reads.
Queue operations are exposed through insert(), peek_*(), pop_*(),
and fapply().
Examples
x <- priority_queue("a", "b", "c", priorities = c(2, 1, 2))
x
#> Unnamed priority_queue with 3 elements.
#> Minimum priority: 1, Maximum priority: 2
#>
#> Elements (by priority):
#>
#> (priority 1)
#> [1] "b"
#>
#> (priority 2)
#> [1] "a"
#>
#> (priority 2)
#> [1] "c"
#>
peek_min(x)
#> [1] "b"
empty_q <- priority_queue()
peek_min(empty_q)
#> NULL