diff --git a/Data Structures/Trees/AVLTree.java b/Data Structures/Trees/AVLTree.java index a3bde289fe15..4bcf402dc0b7 100644 --- a/Data Structures/Trees/AVLTree.java +++ b/Data Structures/Trees/AVLTree.java @@ -1,4 +1,4 @@ -public class AVLtree { +public class AVLTree { private Node root; @@ -200,7 +200,7 @@ private void reheight(Node node){ } public static void main(String[] args) { - AVLtree tree = new AVLtree(); + AVLTree tree = new AVLTree(); System.out.println("Inserting values 1 to 10"); for (int i = 1; i < 10; i++) diff --git a/Data Structures/Trees/LevelOrderTraversal.java b/Data Structures/Trees/LevelOrderTraversal.java index 845ab3760e13..8cb304f18c8f 100644 --- a/Data Structures/Trees/LevelOrderTraversal.java +++ b/Data Structures/Trees/LevelOrderTraversal.java @@ -9,12 +9,12 @@ public Node(int item) } } -class BinaryTree +public class LevelOrderTraversal { // Root of the Binary Tree Node root; - public BinaryTree() + public LevelOrderTraversal() { root = null; } @@ -65,7 +65,7 @@ else if (level > 1) /* Driver program to test above functions */ public static void main(String args[]) { - BinaryTree tree = new BinaryTree(); + LevelOrderTraversal tree = new LevelOrderTraversal(); tree.root= new Node(1); tree.root.left= new Node(2); tree.root.right= new Node(3); diff --git a/Data Structures/Trees/LevelOrderTraversalQueue.java b/Data Structures/Trees/LevelOrderTraversalQueue.java index 4f263c95a882..ce7ad74542cf 100644 --- a/Data Structures/Trees/LevelOrderTraversalQueue.java +++ b/Data Structures/Trees/LevelOrderTraversalQueue.java @@ -14,7 +14,7 @@ public Node(int item) { } /* Class to print Level Order Traversal */ -class BinaryTree { +public class LevelOrderTraversalQueue { Node root; @@ -49,7 +49,7 @@ public static void main(String args[]) { /* creating a binary tree and entering the nodes */ - BinaryTree tree_level = new BinaryTree(); + LevelOrderTraversalQueue tree_level = new LevelOrderTraversalQueue(); tree_level.root = new Node(1); tree_level.root.left = new Node(2); tree_level.root.right = new Node(3); diff --git a/Data Structures/Trees/PrintTopViewofTree.java b/Data Structures/Trees/PrintTopViewofTree.java index a429f8a6fd93..27016ee2eee4 100644 --- a/Data Structures/Trees/PrintTopViewofTree.java +++ b/Data Structures/Trees/PrintTopViewofTree.java @@ -78,7 +78,7 @@ public void printTopView() } // Driver class to test above methods -public class Main +public class PrintTopViewofTree { public static void main(String[] args) { diff --git a/Data Structures/Trees/ValidBSTOrNot.java b/Data Structures/Trees/ValidBSTOrNot.java index 0f71a46a0d14..4b2c08a1a70c 100644 --- a/Data Structures/Trees/ValidBSTOrNot.java +++ b/Data Structures/Trees/ValidBSTOrNot.java @@ -10,7 +10,7 @@ public Node(int item) } } -public class BinaryTree +public class ValidBSTOrNot { //Root of the Binary Tree Node root; @@ -47,7 +47,7 @@ boolean isBSTUtil(Node node, int min, int max) /* Driver program to test above functions */ public static void main(String args[]) { - BinaryTree tree = new BinaryTree(); + ValidBSTOrNot tree = new ValidBSTOrNot(); tree.root = new Node(4); tree.root.left = new Node(2); tree.root.right = new Node(5);