Modified Data Structures/Trees folder .java file name and class name

This commit is contained in:
unknown 2017-12-16 19:04:10 +09:00
parent dcf7f8f657
commit 6dcce9f3e0
5 changed files with 10 additions and 10 deletions

View File

@ -1,4 +1,4 @@
public class AVLtree { public class AVLTree {
private Node root; private Node root;
@ -200,7 +200,7 @@ public class AVLtree {
} }
public static void main(String[] args) { public static void main(String[] args) {
AVLtree tree = new AVLtree(); AVLTree tree = new AVLTree();
System.out.println("Inserting values 1 to 10"); System.out.println("Inserting values 1 to 10");
for (int i = 1; i < 10; i++) for (int i = 1; i < 10; i++)

View File

@ -9,12 +9,12 @@ class Node
} }
} }
class BinaryTree public class LevelOrderTraversal
{ {
// Root of the Binary Tree // Root of the Binary Tree
Node root; Node root;
public BinaryTree() public LevelOrderTraversal()
{ {
root = null; root = null;
} }
@ -65,7 +65,7 @@ class BinaryTree
/* Driver program to test above functions */ /* Driver program to test above functions */
public static void main(String args[]) public static void main(String args[])
{ {
BinaryTree tree = new BinaryTree(); LevelOrderTraversal tree = new LevelOrderTraversal();
tree.root= new Node(1); tree.root= new Node(1);
tree.root.left= new Node(2); tree.root.left= new Node(2);
tree.root.right= new Node(3); tree.root.right= new Node(3);

View File

@ -14,7 +14,7 @@ class Node {
} }
/* Class to print Level Order Traversal */ /* Class to print Level Order Traversal */
class BinaryTree { public class LevelOrderTraversalQueue {
Node root; Node root;
@ -49,7 +49,7 @@ class BinaryTree {
{ {
/* creating a binary tree and entering /* creating a binary tree and entering
the nodes */ the nodes */
BinaryTree tree_level = new BinaryTree(); LevelOrderTraversalQueue tree_level = new LevelOrderTraversalQueue();
tree_level.root = new Node(1); tree_level.root = new Node(1);
tree_level.root.left = new Node(2); tree_level.root.left = new Node(2);
tree_level.root.right = new Node(3); tree_level.root.right = new Node(3);

View File

@ -78,7 +78,7 @@ class Tree
} }
// Driver class to test above methods // Driver class to test above methods
public class Main public class PrintTopViewofTree
{ {
public static void main(String[] args) public static void main(String[] args)
{ {

View File

@ -10,7 +10,7 @@ class Node
} }
} }
public class BinaryTree public class ValidBSTOrNot
{ {
//Root of the Binary Tree //Root of the Binary Tree
Node root; Node root;
@ -47,7 +47,7 @@ public class BinaryTree
/* Driver program to test above functions */ /* Driver program to test above functions */
public static void main(String args[]) public static void main(String args[])
{ {
BinaryTree tree = new BinaryTree(); ValidBSTOrNot tree = new ValidBSTOrNot();
tree.root = new Node(4); tree.root = new Node(4);
tree.root.left = new Node(2); tree.root.left = new Node(2);
tree.root.right = new Node(5); tree.root.right = new Node(5);