Skip to content

Commit 84030fd

Browse files
committed
Move info into individual modules.
1 parent 90304ed commit 84030fd

File tree

5 files changed

+26
-10
lines changed

5 files changed

+26
-10
lines changed

src/libcollections/priority_queue.rs

+5
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@
1010

1111
//! A priority queue implemented with a binary heap.
1212
//!
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+
//!
1318
//! # Example
1419
//!
1520
//! This is a larger example which implements [Dijkstra's algorithm][dijkstra]

src/libcollections/ringbuf.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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`.
1515
1616
use core::prelude::*;
1717

src/libcollections/treemap.rs

+7-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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.
1418
//!
1519
//! ## Example
1620
//!

src/libcollections/trie.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,13 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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.
1318
1419
use core::prelude::*;
1520

src/libcollections/vec.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
// option. This file may not be copied, modified, or distributed
99
// except according to those terms.
1010

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).
1214
1315
use core::prelude::*;
1416

0 commit comments

Comments
 (0)