]> git.lizzy.rs Git - rust.git/commitdiff
Move info into individual modules.
authorSteve Klabnik <steve@steveklabnik.com>
Sat, 30 Aug 2014 21:11:22 +0000 (17:11 -0400)
committerSteve Klabnik <steve@steveklabnik.com>
Sat, 13 Sep 2014 19:05:56 +0000 (15:05 -0400)
src/libcollections/priority_queue.rs
src/libcollections/ringbuf.rs
src/libcollections/treemap.rs
src/libcollections/trie.rs
src/libcollections/vec.rs

index da8cf085218f453bef6fd53f3303ed64825e8e86..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]
index 3665535e720153c8ccc2da346a237dff810ac387..aa745ef39ee13a23d44da8b96573d30b2a0cb154 100644 (file)
@@ -8,10 +8,10 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! A double-ended queue implemented as a circular buffer.
-//!
-//! `RingBuf` implements the trait `Deque`. It should be imported with
-//! `use collections::Deque`.
+//! This crate implements a double-ended queue with `O(1)` amortized inserts and removals from both
+//! ends of the container. It also has `O(1)` indexing like a vector. The contained elements are
+//! not required to be copyable, and the queue will be sendable if the contained type is sendable.
+//! Its interface `Deque` is defined in `collections`.
 
 use core::prelude::*;
 
index 80a7c6d4bad1dc5f90ae2f3342ffa46227512e8c..354edae473fd58450e86eed411b3f05ae5b65ba2 100644 (file)
@@ -8,9 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! An ordered map and set implemented as self-balancing binary search
-//! trees. The only requirement for the types is that the key implements
-//! `Ord`.
+//! Maps are collections of unique keys with corresponding values, and sets are
+//! just unique keys without a corresponding value. The `Map` and `Set` traits in
+//! `std::container` define the basic interface.
+//!
+//! This crate defines the `TreeMap` and `TreeSet` types. Their keys must implement `Ord`.
+//!
+//! `TreeMap`s are ordered.
 //!
 //! ## Example
 //!
index fa8bcf94de1cd6fbfff2b2b06f6e32b1f817f39b..7d60d3a85e1288483d7997f73ef7bcbbc26bac4b 100644 (file)
@@ -8,8 +8,13 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! Ordered containers with unsigned integer keys,
-//! implemented as radix tries (`TrieSet` and `TrieMap` types).
+//! Maps are collections of unique keys with corresponding values, and sets are
+//! just unique keys without a corresponding value. The `Map` and `Set` traits in
+//! `std::container` define the basic interface.
+//!
+//! This crate defines `TrieMap` and `TrieSet`, which require `uint` keys.
+//!
+//! `TrieMap` is ordered.
 
 use core::prelude::*;
 
index a7005cf454db5fb9a5ba74b4a9013984034bf771..34b3b11df00b53b948a9ef96b32ce8b93e7c8261 100644 (file)
@@ -8,7 +8,9 @@
 // option. This file may not be copied, modified, or distributed
 // except according to those terms.
 
-//! An owned, growable vector.
+//! A growable list type, written `Vec<T>` but pronounced 'vector.'
+//!
+//! Vectors have `O(1)` indexing, push (to the end) and pop (from the end).
 
 use core::prelude::*;