AVL Node

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

Lecture Data Structure (Java): AVL Node

public class AVLNode extends BTNode{


private int w;
private int lh;
private int rh;

public AVLNode(Object o, BTNode l, BTNode r, int leftHeight, int rightHeight, int weight){
super(o, l, r);
w = weight;
lh =leftHeight;
rh = rightHeight;
}

public int getWeight(){return w;}


public void setWeight(int weight) {w = weight;}
public int getLeftHeight() {return lh;}
public void setLeftHeight(int leftHeight) {lh = leftHeight;}
public int getRightHeight() {return rh;}
public void setRightHeight(int rightHeight) {rh = rightHeight;}
}

You might also like