diff options
Diffstat (limited to 'week4/AVLTree.cs')
-rw-r--r-- | week4/AVLTree.cs | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/week4/AVLTree.cs b/week4/AVLTree.cs new file mode 100644 index 0000000..fdc3a24 --- /dev/null +++ b/week4/AVLTree.cs @@ -0,0 +1,23 @@ +namespace ALGA { + public class AVLTree { + public Node root; + + public void insert(int number) { + if (root == null) { + root = new Node(number); + return; + } + root = root.insert(number); + } + + public bool isBalanced() { + if (root == null) return true; + return root.isBalanced(); + } + + public void prettyprint() { + return; + } + } +} + |