Skip to content

Instantly share code, notes, and snippets.

View codingvideo's full-sized avatar
🎯
Focusing

codingvideo

🎯
Focusing
View GitHub Profile
// a simple bubble sort algorithm implemented in Rust
fn main(){
let data = &mut [3, 4, 1, 5, 2];
loop {
let mut has_swapped = false;
for i in 0..data.len() - 1 {
let a = i;
let b = (i+1) as usize;
if data[a] > data[b] {