Skip to content

Commit

Permalink
Update AVLSimple
Browse files Browse the repository at this point in the history
  • Loading branch information
Ritik2604 authored May 24, 2020
1 parent f710f3a commit 82e2132
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions DataStructures/Trees/AVLSimple
Original file line number Diff line number Diff line change
@@ -1,3 +1,34 @@

package DataStructures.Trees;

/*
* Avl is algo that balance itself while adding new alues to tree
* by rotating branches of binary tree and make itself Binary seaarch tree
* there are four cases which has to tackle
* rotating - left right ,left left,right right,right left

Test Case:

AVLTree tree=new AVLTree();
tree.insert(20);
tree.insert(25);
tree.insert(30);
tree.insert(10);
tree.insert(5);
tree.insert(15);
tree.insert(27);
tree.insert(19);
tree.insert(16);

tree.display();




*/



public class AVLTree {
private class Node{
int data;
Expand Down

0 comments on commit 82e2132

Please sign in to comment.