diff --git a/DataStructures/SplayTree/SplayTree.php b/DataStructures/SplayTree/SplayTree.php index ac8e80b..c14b64a 100644 --- a/DataStructures/SplayTree/SplayTree.php +++ b/DataStructures/SplayTree/SplayTree.php @@ -44,7 +44,7 @@ public function getRoot(): ?SplayTreeNode * Set the root node of the Splay Tree. * @param SplayTreeNode $node */ - public function setRoot(SplayTreeNode $node): void + protected function setRoot(SplayTreeNode $node): void { $this->root = $node; } diff --git a/DataStructures/SplayTree/SplayTreeRotations.php b/DataStructures/SplayTree/SplayTreeRotations.php index ec4ad36..3375caa 100644 --- a/DataStructures/SplayTree/SplayTreeRotations.php +++ b/DataStructures/SplayTree/SplayTreeRotations.php @@ -13,6 +13,7 @@ abstract class SplayTreeRotations { abstract protected function splay(?SplayTreeNode $node, int $key): ?SplayTreeNode; + abstract protected function setRoot(SplayTreeNode $node): void; /** * Zig rotation (single right rotation).