File tree 5 files changed +26
-10
lines changed
5 files changed +26
-10
lines changed Original file line number Diff line number Diff line change 10
10
11
11
//! A priority queue implemented with a binary heap.
12
12
//!
13
+ //! Insertions have `O(log n)` time complexity and checking or popping the largest element is
14
+ //! `O(1)`. Converting a vector to a priority queue can be done in-place, and has `O(n)`
15
+ //! complexity. A priority queue can also be converted to a sorted vector in-place, allowing it to
16
+ //! be used for an `O(n log n)` in-place heapsort.
17
+ //!
13
18
//! # Example
14
19
//!
15
20
//! This is a larger example which implements [Dijkstra's algorithm][dijkstra]
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- //! A double-ended queue implemented as a circular buffer.
12
- //!
13
- //! `RingBuf` implements the trait `Deque`. It should be imported with
14
- //! `use collections::Deque `.
11
+ //! This crate implements a double-ended queue with `O(1)` amortized inserts and removals from both
12
+ //! ends of the container. It also has `O(1)` indexing like a vector. The contained elements are
13
+ //! not required to be copyable, and the queue will be sendable if the contained type is sendable.
14
+ //! Its interface `Deque` is defined in ` collections`.
15
15
16
16
use core:: prelude:: * ;
17
17
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- //! An ordered map and set implemented as self-balancing binary search
12
- //! trees. The only requirement for the types is that the key implements
13
- //! `Ord`.
11
+ //! Maps are collections of unique keys with corresponding values, and sets are
12
+ //! just unique keys without a corresponding value. The `Map` and `Set` traits in
13
+ //! `std::container` define the basic interface.
14
+ //!
15
+ //! This crate defines the `TreeMap` and `TreeSet` types. Their keys must implement `Ord`.
16
+ //!
17
+ //! `TreeMap`s are ordered.
14
18
//!
15
19
//! ## Example
16
20
//!
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- //! Ordered containers with unsigned integer keys,
12
- //! implemented as radix tries (`TrieSet` and `TrieMap` types).
11
+ //! Maps are collections of unique keys with corresponding values, and sets are
12
+ //! just unique keys without a corresponding value. The `Map` and `Set` traits in
13
+ //! `std::container` define the basic interface.
14
+ //!
15
+ //! This crate defines `TrieMap` and `TrieSet`, which require `uint` keys.
16
+ //!
17
+ //! `TrieMap` is ordered.
13
18
14
19
use core:: prelude:: * ;
15
20
Original file line number Diff line number Diff line change 8
8
// option. This file may not be copied, modified, or distributed
9
9
// except according to those terms.
10
10
11
- //! An owned, growable vector.
11
+ //! A growable list type, written `Vec<T>` but pronounced 'vector.'
12
+ //!
13
+ //! Vectors have `O(1)` indexing, push (to the end) and pop (from the end).
12
14
13
15
use core:: prelude:: * ;
14
16
You can’t perform that action at this time.
0 commit comments