Floyds Algorithm

```// floyds_algorithm.rs

let mut steps_until_reset = 1;
let mut times_reset = 0;

while let Some(node) = current {
steps_until_reset -= 1;
if steps_until_reset == 0 {
checkpoint = current;
times_reset += 1;
steps_until_reset = 1 << times_reset; // 2^times_reset
}

unsafe {
let node_ptr = node.as_ptr();
let next = (*node_ptr).next;
current = next;
}
if current == checkpoint {
}
}

None
}

while let (Some(slow_node), Some(fast_node)) = (slow, fast) {
unsafe {
slow = slow_node.as_ref().next;
fast = fast_node.as_ref().next;

if let Some(fast_next) = fast {
// fast = (*fast_next.as_ptr()).next;
fast = fast_next.as_ref().next;
} else {
return false; // If fast reaches the end, there's no cycle
}

if slow == fast {
return true; // Cycle detected
}
}
}
// println!("{}", flag);
false // No cycle detected
}

#[cfg(test)]
mod tests {
use super::*;

#[test]
fn test_detect_cycle_no_cycle() {

}

#[test]
fn test_detect_cycle_with_cycle() {

// Create a cycle for testing
unsafe {
if let Some(mut tail) = linked_list.tail {