Crate algs4_rs

Crate algs4_rs 

Source

Modules§

threesum
Take n integers and counts the number of triples that sum to exactly 0.
threesum_fast
Take n integers and counts the number of triples that sum to exactly 0.
twosum
Take n integers and counts the number of pairs that sum to exactly 0.
twosum_fast
Take n integers and counts the number of pairs that sum to exactly 0.

Macros§

svec
Similar to macro std::vec!.

Structs§

BST
An ordered symbol table of generic key-value pairs, implemented with a binary search tree.
BreadthFirstPaths
Finds shortest paths (number of edges) from a source vertex s (or a set of source vertices) to every other vertex in an undirected graph, using breadth-first search.
DepthFirstPaths
Finds paths from a source vertex s to every other vertex in an undirected graph, using depth-first search.
Drain
A draining iterator for SVec.
FileIn
File input.
Graph
An undirected graph. Parallel edges and self-loops allowed.
In
General Input (stdin, file, socket, etc.).
InvalidArgument
Error type used to indicate an invalid argument
Keys
Iterator over all the keys of the given BST.
KeysLevelOrder
Iterator over all the keys of the BST in level order.
KeysRange
Iterator over all the keys of the BST in the given range.
LinearRegression
Computes least squares solution to y = β * x + α.
LinedQueueIter
LinedStackIter
LinkedBag
A bag (or multiset) of generic items.
LinkedBagIter
LinkedQueue
A first-in-first-out (FIFO) queue of generic items.
LinkedStack
A last-in-first-out (LIFO) stack of generic items.
MaxPQ
A priority queue of generic keys. A better alternative is std::collections::BinaryHeap.
MaxPQIntoIter
MinPQ
A priority queue of generic keys. A better alternative is std::collections::BinaryHeap.
MinPQIntoIter
ResizingBag
A bag (or multiset) of generic items.
ResizingBagIter
ResizingQueue
A first-in-first-out (FIFO) queue of generic items.
ResizingQueueIter
ResizingStack
A last-in-first-out (LIFO) stack of generic items.
ResizingStackIter
SVec
A Simple Vector. Inspired by the Vec in The Rustonomicon, with some differences.
SVecIntoIter
SVecQue
A first-in-first-out (FIFO) queue of generic items.
SVecQueIter
Scanner
Takes a BufRead for a text input, and yields the next entity until EOF is reached.
StdIn
Standard input of this library.

Enums§

Algs4Error
Error type used for this library.

Traits§

PrimFloat
A trait that represents all the Rust primivive floating point types.
PrimInt
A trait that represents all the Rust primivive integers.

Functions§

heap_sort
Sorts a slice using heapsort.
index_of
Returns the index of the specified key in the specified sequence, or -1 if not found.
index_of_i32_seq
Returns the index of the specified key in the specified sequence, or -1 if not found.
index_of_i64_seq
Returns the index of the specified key in the specified sequence, or -1 if not found.