2 releases
0.1.1 | Apr 20, 2024 |
---|---|
0.1.0 | Apr 19, 2024 |
#894 in Algorithms
43 downloads per month
110KB
111 lines
Sort Library
This is a Rust library containing implementations of various sorting algorithms. You can use this library to sort slices of any comparable type.
Usage
1. Download and Use Locally
To use this library locally, follow these steps:
-
Clone the repository:
git clone https://github.com/rulik04/sort_library.git <destination_folder_path>
Replace <destination_folder_path> with the path to the folder where you want to clone the repository. sort_library and the project where you want to use this library must be in the same folder.
-
Use the sorting algorithms in your Rust project by importing the desired module:
use sort_library::{insertion_sort, merge_sort, quick_sort, selection_sort};
2. Using via GitHub in dependencies
Add the following line to your Cargo.toml
file under [dependencies]
:
```toml
sort_library = { git = "https://github.com/rulik04/sort_library.git" }
```
Then you can import and use the sorting algorithms as mentioned in the previous section.
3. Add via crates.io
Add the library to your Cargo.toml
file using the cargo add
command:
cargo add sort_library
And then you can import and use the sorting algorithms as mentioned in the previous sections.