[rust] cache-aware DP - approx tree (#1934)

This commit is contained in:
Byron Hsu
2024-11-10 21:57:32 -08:00
committed by GitHub
parent 087ab83223
commit f9633fa9b9
13 changed files with 1472 additions and 177 deletions

View File

@@ -67,7 +67,7 @@ fn test_prefix_match_partial() {
fn test_prefix_match_no_match() {
let mut tree = RadixTree::new();
tree.insert(&[1, 2, 3, 4]);
let empty_slices: &[usize] = &[];
let empty_slices: &[u32] = &[];
assert_eq!(tree.prefix_match(&[5, 6, 7]), empty_slices);
}
@@ -124,7 +124,7 @@ fn test_delete_nonexistent() {
#[test]
fn test_empty_input() {
let mut tree = RadixTree::new();
let empty_slice: &[usize] = &[];
let empty_slice: &[u32] = &[];
tree.insert(empty_slice);
assert_eq!(tree.prefix_match(empty_slice), empty_slice);
tree.delete(empty_slice); // Should not panic