aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

This commit is contained in:
jacekpoz 2024-06-06 07:28:03 +02:00
parent 965bb36b0b
commit a475e4f7cf
Signed by: poz
SSH key fingerprint: SHA256:JyLeVWE4bF3tDnFeUpUaJsPsNlJyBldDGV/dIKSLyN8
4 changed files with 7 additions and 2 deletions

2
lab4/zad6/Cargo.lock generated
View file

@ -275,7 +275,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0"
[[package]]
name = "zad4"
name = "zad6"
version = "0.1.0"
dependencies = [
"dashmap",

View file

@ -1,5 +1,5 @@
[package]
name = "zad4"
name = "zad6"
version = "0.1.0"
edition = "2021"

View file

@ -76,6 +76,8 @@ fn write_max(results_map: &DashMap<u64, Vec<Stats>>) -> DashMap<u64, u64> {
fn main() -> io::Result<()> {
rayon::ThreadPoolBuilder::new().stack_size(1024 * 1024 * 1024).build_global().unwrap();
let m = 20;
let asc_results: Arc<DashMap<u64, Vec<Stats>>> = Arc::new(DashMap::new());

View file

@ -292,8 +292,10 @@ impl SplayTree {
if node.parent() == self.root {
self.stats.reads += 1;
if node == node.parent().left() {
self.stats.reads += 1;
self.rotate_right(node.parent());
} else {
self.stats.reads += 1;
self.rotate_left(node.parent());
}
} else {
@ -382,6 +384,7 @@ impl SplayTree {
let mut temp = &self.root;
unsafe {
loop {
self.stats.comparisons += 1;
let next = match key.cmp(&(*temp.0).key) {
Ordering::Less => &mut (*temp.0).left,
Ordering::Greater => &mut (*temp.0).right,