From 991388604f3e01b9f9fb286945ba6a8ff4d29904 Mon Sep 17 00:00:00 2001 From: Matej Focko Date: Mon, 16 May 2022 18:44:24 +0200 Subject: [PATCH] fix: improve deletion Signed-off-by: Matej Focko --- ranked_tree.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ranked_tree.js b/ranked_tree.js index 6963715..8ce15e1 100644 --- a/ranked_tree.js +++ b/ranked_tree.js @@ -139,13 +139,14 @@ class RankedTree { successor.value = null; this.record( "Replacing the value of deleted node with successor value", - node + node, + successor ); return this.deleteNode(successor); } - this.record("Replacing the node with one of its children", node); + this.record("Replacing the node with one of its children", node, y); return [y, parent]; }