Giter Site home page Giter Site logo

mfournial / collections-rust Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 1.0 48 KB

Common data structure and algorithms for rust-lang

License: Other

Rust 100.00%
rust rust-library rust-lang datastructures heap heapsort queue priority-queue collections framework generics

collections-rust's Introduction

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

collections-rust's People

Contributors

mfournial avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Forkers

kedia-project

collections-rust's Issues

Change PQueue from veg to []

Expected Behavior

Heap should be implemented using a slice for better performance

Current Behavior

The PQueue holds a Vector, making operations like deleting last element tricky as another function might change the ordering of Vec::push and pop

Online docs

TODO

Set up online docs with link in README.
Possibly with link to either gitlab jobs artefacts, travis or Crates.io

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.