| Crates.io | pofk_algorithm |
| lib.rs | pofk_algorithm |
| version | 0.0.3 |
| created_at | 2025-08-11 09:32:20.043696+00 |
| updated_at | 2025-08-11 09:36:37.97415+00 |
| description | A collection of efficient algorithms implemented in Rust for real-world projects. |
| homepage | https://pofklabs.vercel.app |
| repository | https://github.com/POFKLabs/pofk_algorithm_rust |
| max_upload_size | |
| id | 1789827 |
| size | 273,901 |

A comprehensive, fast, and extensible algorithms library for Rust. Includes classic and modern techniques for lists, sets, maps, strings, graphs, and more β built with idiomatic Rust, strong typing, and clean APIs.
Environment: Rust 1.70+ (see Cargo.toml).
Add to your Cargo.toml:
[dependencies]
pofk_algorithm = "0.0.1"
use pofk_algorithm::*;
use pofk_algorithm::{
list_algorithms::{binary_search, merge_sort},
string_algorithms::{is_palindrome, longest_common_prefix},
graph_algorithms::{dijkstra, WeightedEdge},
};
fn main() {
// List algorithms
let arr = vec![1, 3, 5, 7, 9];
let idx = binary_search(&arr, 7);
let sorted = merge_sort(vec![5, 2, 4, 6, 1, 3]);
// String algorithms
let is_pal = is_palindrome("A man a plan a canal Panama");
let lcp = longest_common_prefix(&["flower", "flow", "flight"]);
// Graph algorithms
let graph = vec![
("A", vec![WeightedEdge::new("A", "B", 1), WeightedEdge::new("A", "C", 4)]),
("B", vec![WeightedEdge::new("B", "C", 2)]),
("C", vec![]),
].into_iter().collect();
let dist = dijkstra(&graph, "A");
println!("{:?}", (idx, sorted, is_pal, lcp, dist));
}
Each function includes Dartdoc with usage and time/space complexity.
pofk_algorithm::*;T extends Comparable where appropriate.WeightedEdge<T>.cargo test
All tests pass in the repository (see test/).
Contributions are welcome!
Open a PR with a brief description and test cases.
MIT. See LICENSE.