You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/Containers-AVL-Tree/CTAVLNilNode.class.st
+43-6Lines changed: 43 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,7 @@
1
1
"
2
2
AVLNilNode is a special sentinel node used in AVL trees to represent the absence of a node.
3
3
4
-
In an AVL tree, `AVLNilNode` is used to represent the missing node. It serves as a placeholder for null references, making it easier to perform tree operations without having to deal with special cases for missing children.
5
-
6
-
`AVLNilNode` is a subclass of `AVLAbstractNode`, and it provides default implementations for methods that are specific to nil nodes, such as `addChild:` and `isNilNode`.
7
-
8
-
This class allows AVL trees to be implemented more cleanly and efficiently by treating missing nodes as instances of `AVLNilNode`.
4
+
In an AVL tree, `AVLNilNode` is used as a placeholder for null references, making it easier to perform tree operations without special cases for missing children. It fully implements the Null Object pattern.
Copy file name to clipboardExpand all lines: src/Containers-AVL-Tree/CTAVLNode.class.st
+48-76Lines changed: 48 additions & 76 deletions
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@ AVLNode represents a node in an AVL tree.
3
3
4
4
An AVL tree is a self-balancing binary search tree where the heights of the two child subtrees of every node differ by at most one. The `AVLNode` class extends the `AVLAbstractNode` class and provides the implementation of actual nodes within the AVL tree.
5
5
6
-
AVLNode instances hold a `contents` instance variable. These nodes are organized in such a way that the tree remains balanced, ensuring efficient operations like insertion, deletion, and search.
6
+
AVLNode instances hold a `contents` instance variable. These nodes are organized to keep the tree balanced, ensuring efficient operations like insertion, deletion, and search.
7
7
8
8
This class should not be used directly; instead use `AVLTree`.
0 commit comments