]> git.lizzy.rs Git - rust.git/blobdiff - src/libcollections/priority_queue.rs
rollup merge of #17355 : gamazeps/issue17210
[rust.git] / src / libcollections / priority_queue.rs
index 674fa129943e7fcf0215f9d6b6c12025c12bc9d5..68e2086d042a36e45789949d7c10c096bf79ab3c 100644 (file)
 
 //! A priority queue implemented with a binary heap.
 //!
+//! Insertions have `O(log n)` time complexity and checking or popping the largest element is
+//! `O(1)`. Converting a vector to a priority queue can be done in-place, and has `O(n)`
+//! complexity. A priority queue can also be converted to a sorted vector in-place, allowing it to
+//! be used for an `O(n log n)` in-place heapsort.
+//!
 //! # Example
 //!
 //! This is a larger example which implements [Dijkstra's algorithm][dijkstra]
@@ -516,7 +521,7 @@ fn siftdown(&mut self, pos: uint) {
 }
 
 /// `PriorityQueue` iterator.
-pub struct Items <'a, T> {
+pub struct Items <'a, T:'a> {
     iter: slice::Items<'a, T>,
 }