package ddAsAVL;

public class AVLNode {

	int key; 
	String data; 
	AVLNode left, right; 
	int height;
	int extant;
	
	public AVLNode(int key, String data, AVLNode left, AVLNode right){
		this.key = key; 
		this.data = data; 
		this.left = left; 
		this.right = right; 
		this.extant=1;
		
		//if the node is at the bottom, you'll ultimately want it to have height 0, which it will
		//Otherwise, you'll set it to one more than the height of its children
		int leftsHeight = (left==null)? -1 : left.height;
		int rightsHeight = (right==null)? -1 : right.height;
		height = 1 + Math.max(leftsHeight, rightsHeight);
		
	}
	
}
