Skip to content

Commit

Permalink
forgot one fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Théo Degioanni committed Oct 24, 2020
1 parent 5a744ad commit 96e7a9c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Rust_implem/src/binary_heap.rs
Expand Up @@ -45,8 +45,10 @@ impl<K: Ord, V> BinaryHeapVec<K, V> {
}
} else {
// The current index only has one child
self.data.swap(index, c1);
self.fix_down_at(c1)
if k_self > k1 {
self.data.swap(index, c1);
self.fix_down_at(c1);
}
}
}
}
Expand Down

0 comments on commit 96e7a9c

Please sign in to comment.