% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/40-priority_queue-constructors.R
\name{priority_queue}
\alias{priority_queue}
\title{Construct a Priority Queue}
\usage{
priority_queue(..., priorities)
}
\arguments{
\item{...}{Elements to enqueue.}

\item{priorities}{Priorities with the same length as \code{...}.}
}
\value{
A \code{priority_queue}.
}
\description{
Creates a \code{priority_queue} from elements in \code{...} and matching
\code{priorities}.
}
\details{
Empty construction is supported: \code{priority_queue()} returns an empty queue.

If elements are named, names are preserved for name-based reads.

Queue operations are exposed through \code{insert()}, \verb{peek_*()}, \verb{pop_*()},
and \code{fapply()}.
}
\examples{
x <- priority_queue("a", "b", "c", priorities = c(2, 1, 2))
x
peek_min(x)

empty_q <- priority_queue()
peek_min(empty_q)
}
