pub fn decrease_key(&mut self, element: T) {
let position = self.positions[element.as_index()];
pub fn decrease_key(&mut self, element: T) {
let position = self.positions[element.as_index()];
self.data[position] = element;
self.move_up_in_tree(position);
}
/// Updates the key of an element if the new key is larger than the old key.
self.data[position] = element;
self.move_up_in_tree(position);
}
/// Updates the key of an element if the new key is larger than the old key.
pub fn increase_key(&mut self, element: T) {
let position = self.positions[element.as_index()];
pub fn increase_key(&mut self, element: T) {
let position = self.positions[element.as_index()];