Giter Site home page Giter Site logo

mr-unforgettable / algorithm_playground Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 17 KB

Algorithms Playground: To learn and understand the working of different algorithms in Computer Science in one library.

Home Page: https://crates.io/crates/algorithm_playground

License: MIT License

Rust 100.00%
algorithms-and-data-structures rust

algorithm_playground's Introduction

Algorithm Playground

Algorithm Playground is a Rust library that provides implementations of various searching algorithms.

Features

  • Includes implementations of search, sort algorithms.
  • Works with any type that implements the PartialEq or Ord trait.

Installation

To use Algorithm Playground in your Rust project, add it as a dependency in your Cargo.toml file:

[dependencies]
algorithm_playground = "1.0.2"

Usage

Here's an example of how to use the searching algorithms in your Rust code:

use algorithm_playground::algorithms::searching::searching::{linear_search, binary_search};

fn main() {
    let arr = vec![1, 2, 3, 4, 5];
    
    // Perform linear search
    match linear_search(&arr, &3) {
        Some(index) => println!("Found 3 at index {}", index),
        None => println!("3 not found"),
    }

    // Perform binary search (requires sorted array)
    match binary_search(&arr, &3) {
        Some(index) => println!("Found 3 at index {}", index),
        None => println!("3 not found"),
    }
}

Contributing

Contributions to Algorithm Playground are welcome! If you find a bug or have a feature request, please open an issue on GitHub. Pull requests are also appreciated.

License

This project is licensed under the MIT License - see the LICENSE file for details.

algorithm_playground's People

Contributors

mr-unforgettable 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.