tmp
This commit is contained in:
parent
5a8e1adf41
commit
19824a8846
7
706_design_hashmap/Cargo.lock
generated
Normal file
7
706_design_hashmap/Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 4
|
||||
|
||||
[[package]]
|
||||
name = "design_hashmap"
|
||||
version = "0.1.0"
|
6
706_design_hashmap/Cargo.toml
Normal file
6
706_design_hashmap/Cargo.toml
Normal file
@ -0,0 +1,6 @@
|
||||
[package]
|
||||
name = "design_hashmap"
|
||||
version = "0.1.0"
|
||||
edition = "2024"
|
||||
|
||||
[dependencies]
|
24
706_design_hashmap/src/lib.rs
Normal file
24
706_design_hashmap/src/lib.rs
Normal file
@ -0,0 +1,24 @@
|
||||
#[derive(Clone)]
|
||||
struct ListNode {
|
||||
key: i32,
|
||||
value: i32,
|
||||
next: Option<Box<ListNode>>,
|
||||
}
|
||||
|
||||
pub struct MyHashMap {
|
||||
buckets: Vec<Option<Box<ListNode>>>,
|
||||
}
|
||||
|
||||
impl MyHashMap {
|
||||
fn new() -> Self {
|
||||
Self {
|
||||
buckets: Vec::with_capacity(8192),
|
||||
}
|
||||
}
|
||||
|
||||
fn put(&self, key: i32, value: i32) {}
|
||||
|
||||
fn get(&self, key: i32) -> i32 {}
|
||||
|
||||
fn remove(&self, key: i32) {}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user