Code Monkey home page Code Monkey logo

rust-collections's Introduction

rust-collections

Learn Rust by implementing collections.

I was inspired by Jon Gjengset's stream on implementing hashmap in rust. I decided to implement other collections myself

HashMap: This is implemented following Jon's stream. Run

cargo r --example hashmap_demo

HashSet: Simplified version that uses std::collections::hash_map::DefaultHasher for hashing key. Standard Hashset implementations internally use HashMap but I decided to implement everything from stratch

cargo r --example hashset_demo

LinkedList: I wanted to use same struct signature as collections crate implementation. This taught me a lot on dealing with Box type and raw pointers. Also added implementation for Display trait for LinkedList. To run this lib we need nightly build features.

cargo +nightly r --example linkedlist_demo

rust-collections's People

Contributors

navakanth-snow avatar teakwood avatar

Watchers

 avatar

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.