]> 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 905078ccc3c8c424c3a792b85fa0009725cb3d57..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]
@@ -515,14 +520,7 @@ fn siftdown(&mut self, pos: uint) {
     }
 }
 
-/// Note: stage0-specific version that lacks bound on A.
-#[cfg(stage0)]
-pub struct Items <'a, T> {
-    iter: slice::Items<'a, T>,
-}
-
 /// `PriorityQueue` iterator.
-#[cfg(not(stage0))]
 pub struct Items <'a, T:'a> {
     iter: slice::Items<'a, T>,
 }