Skip to content

Commit d18033d

Browse files
authored
Merge pull request TheAlgorithms#360 from LeeChungWan/Trees
Modified Data Structures/Trees folder .java file name and class name
2 parents dcf7f8f + 6dcce9f commit d18033d

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

Data Structures/Trees/AVLTree.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
public class AVLtree {
1+
public class AVLTree {
22

33
private Node root;
44

@@ -200,7 +200,7 @@ private void reheight(Node node){
200200
}
201201

202202
public static void main(String[] args) {
203-
AVLtree tree = new AVLtree();
203+
AVLTree tree = new AVLTree();
204204

205205
System.out.println("Inserting values 1 to 10");
206206
for (int i = 1; i < 10; i++)

Data Structures/Trees/LevelOrderTraversal.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ public Node(int item)
99
}
1010
}
1111

12-
class BinaryTree
12+
public class LevelOrderTraversal
1313
{
1414
// Root of the Binary Tree
1515
Node root;
1616

17-
public BinaryTree()
17+
public LevelOrderTraversal()
1818
{
1919
root = null;
2020
}
@@ -65,7 +65,7 @@ else if (level > 1)
6565
/* Driver program to test above functions */
6666
public static void main(String args[])
6767
{
68-
BinaryTree tree = new BinaryTree();
68+
LevelOrderTraversal tree = new LevelOrderTraversal();
6969
tree.root= new Node(1);
7070
tree.root.left= new Node(2);
7171
tree.root.right= new Node(3);

Data Structures/Trees/LevelOrderTraversalQueue.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ public Node(int item) {
1414
}
1515

1616
/* Class to print Level Order Traversal */
17-
class BinaryTree {
17+
public class LevelOrderTraversalQueue {
1818

1919
Node root;
2020

@@ -49,7 +49,7 @@ public static void main(String args[])
4949
{
5050
/* creating a binary tree and entering
5151
the nodes */
52-
BinaryTree tree_level = new BinaryTree();
52+
LevelOrderTraversalQueue tree_level = new LevelOrderTraversalQueue();
5353
tree_level.root = new Node(1);
5454
tree_level.root.left = new Node(2);
5555
tree_level.root.right = new Node(3);

Data Structures/Trees/PrintTopViewofTree.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ public void printTopView()
7878
}
7979

8080
// Driver class to test above methods
81-
public class Main
81+
public class PrintTopViewofTree
8282
{
8383
public static void main(String[] args)
8484
{

Data Structures/Trees/ValidBSTOrNot.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ public Node(int item)
1010
}
1111
}
1212

13-
public class BinaryTree
13+
public class ValidBSTOrNot
1414
{
1515
//Root of the Binary Tree
1616
Node root;
@@ -47,7 +47,7 @@ boolean isBSTUtil(Node node, int min, int max)
4747
/* Driver program to test above functions */
4848
public static void main(String args[])
4949
{
50-
BinaryTree tree = new BinaryTree();
50+
ValidBSTOrNot tree = new ValidBSTOrNot();
5151
tree.root = new Node(4);
5252
tree.root.left = new Node(2);
5353
tree.root.right = new Node(5);

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy