Skip to content

Instantly share code, notes, and snippets.

class Node
{
int data;
Node left;
Node right;
public Node(int data)
{
this.data = data;
left= null;
// implementation of AVL Tree
// It is self balancing binary search tree where the difference between heights of the
// left & right sub tree cannot be morethan one for all nodes
// or we can say that it is a Balanced binary search tree
// the benefit is it requires less time to traverse, insert, delete a node than a non AVL Tree
//We can convert a binary sub tree to AVL Tree by using the 4 methods called (AVL tree Rotations)
public class Quick {
public static void main(String[] args) {
int[] intarray = {20,35,-15,7,55,1,-22};
quickSort(intarray, 0,intarray.length);
for(int i = 0;i<intarray.length;i++)
{
public class Quick {
public static void main(String[] args) {
int[] intarray = {20,35,-15,7,55,1,-22};
quickSort(intarray, 0,intarray.length);
for(int i = 0;i<intarray.length;i++)
{
@neer2808
neer2808 / Test.java
Created August 15, 2020 13:08
neeraj
public class Test {
public static void main(String[] args) {
String[] days = new String[] {"sun", "mon", "tue", "wed", "thr", "fri", "sat", "sun"} ;
for(int i =1;i<=days.length ;i++)
System.out.println (days[i]);
int arr[] = new int[] {10,20,30,40};
}
public class ConstructorDemo {
int num1, num2; // instance variable
// public void setvalue()
// {
// num1 = 10;
// num2 = 20;
// }
public ConstructorDemo()
{
class emp
{
int empid; // instance variables
String name; //instance variables
// non parameterised constructor
emp()
{
empid = 10;
name = "abc";
//System.out.println("constructor invoked ");
class emp
{
int empid;
String name;
public emp() {
}
class emp
{
int empid;
String name;
public emp() {
}
public class Constructor123 {
int rollno; // instance variable
String name;
Constructor123 ()
{
rollno = 10;
name = "ABC";
}
Constructor123(String str)
{