We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f710f3a commit 82e2132Copy full SHA for 82e2132
DataStructures/Trees/AVLSimple
@@ -1,3 +1,34 @@
1
+
2
+package DataStructures.Trees;
3
4
+/*
5
+* Avl is algo that balance itself while adding new alues to tree
6
+* by rotating branches of binary tree and make itself Binary seaarch tree
7
+* there are four cases which has to tackle
8
+* rotating - left right ,left left,right right,right left
9
10
+Test Case:
11
12
+AVLTree tree=new AVLTree();
13
+ tree.insert(20);
14
+ tree.insert(25);
15
+ tree.insert(30);
16
+ tree.insert(10);
17
+ tree.insert(5);
18
+ tree.insert(15);
19
+ tree.insert(27);
20
+ tree.insert(19);
21
+ tree.insert(16);
22
23
+ tree.display();
24
25
26
27
28
+*/
29
30
31
32
public class AVLTree {
33
private class Node{
34
int data;
0 commit comments