assign1

Crates.ioassign1
lib.rsassign1
version0.1.1
sourcesrc
created_at2024-04-17 16:14:49.971625
updated_at2024-04-17 16:24:24.993322
descriptionSorting code
homepagehttps://github.com/Lin0Andy/BT2_Assignment1/tree/master
repositoryhttps://github.com/Lin0Andy/BT2_Assignment1.git
max_upload_size
id1211523
size4,597
(Lin0Andy)

documentation

README

Rust Sorting Library

Usage

This Rust library crate provides sorting algorithms for sorting various types of objects. It includes implementations of Quick Sort, Selection Sort, Insertion Sort, and Merge Sort.

To use this library in your Rust project, add the following line to your Cargo.toml file:

[dependencies]
assign1 = "0.1.0"

## Demo Screenshots



## Examples

Here's a simple example demonstrating how to use the sorting functions provided by this library:

use sorting_library::{quick_sort, selection_sort, insertion_sort, merge_sort};

fn main() { let mut numbers = vec![3, 1, 4, 1, 5, 9, 2, 6];

// Sort using Quick Sort
quick_sort(&mut numbers);
println!("Sorted using Quick Sort: {:?}", numbers);

// Sort using Selection Sort
selection_sort(&mut numbers);
println!("Sorted using Selection Sort: {:?}", numbers);

// Sort using Insertion Sort
insertion_sort(&mut numbers);
println!("Sorted using Insertion Sort: {:?}", numbers);

// Sort using Merge Sort
merge_sort(&mut numbers);
println!("Sorted using Merge Sort: {:?}", numbers);

}

Commit count: 2

cargo fmt