#priority-queue #collection #algorithm #structure #heap #time

collections-more

Common data structure and algorithms for rust-lang to complete the already excellent std::collections

5 releases

Uses old Rust 2015

0.1.4 Dec 17, 2017
0.1.3 Dec 7, 2017
0.1.2 Dec 7, 2017
0.1.1 Dec 6, 2017
0.1.0 Dec 6, 2017

#2433 in Data structures


Used in vampire_api

Custom license

18KB
251 lines

Collections and algorithms for Rust-lang

Crates version Documentation Build Status Pipeline Status codecov standard-readme compliant

This crate is an extension of the rust collections crate. If you're used to C++ algorithms and the various Java collections you'll feel just at home.
You should use this crate if you want to use some general purpose data structures very easily. Each of them have been tested, and the concurrent versions are thread safe. So scale your project and use lighting fast DS with this crate!

Celebs talking about this project:

The best open source project yet (Linus Torvalds)
I wish I had this idea for Microsoft (Bill Gates)
Collections-more is a true revolution (Steve Jobs at RustConf 2017)

Table of contents

Install

Add this line to your cargo.toml in your [dependencies] section:

[dependencies]
# ...
collections_more = "X.X.X"

replacing X.X.X with the version number with the one on the badge above and you should be good to go!

Usage

Usage is still being decided and shall for now be marked as a work in progress. We have to evaluate what's the Rust way of packaging easily before committing ourselves to a design.
As for example of how to use the different data structures, please refer to the integration tests in the tests folder that show exactly how everything will be holding on in time. The documentation should be very useful to guide you on how to use the various functionalities of this project.
The full details of what is currently available in this library can be found in the documentation, this document being only a facade to the project. Nevertheless it is important to give a few example to understand the purpose of this library so here they are:

extern crate collections_more;

// snip

use collections_more::priority_queue::PriorityQueue;

fn main() {
	let pq = PriorityQueue::pqueue!(1, 5, 3); // Creates a priority_queue using the macro
	asserteq!(Some(5), pq.poll()); // Gets the biggest element of the queue O(1)
	asserteq!(2, pq.len()); // Size of the queue after removing biggest element
}

Contribute

We most welcome contributions from you. Issue is generally a good safe way to go. For more active participation, forking the project and opening a pull request is also acceptable. For security related issues, a more direct email is recommended (email in cargo.toml file).
You may take a look at the code of conduct that apply as some sort of by-law between participants. If you have anything to report please send an email at the address in the cargo.toml file.

License

MIT © 2017 - mfournial Mayeul (Mike) Fournial

No runtime deps