public static void assignLeaves(TreeNode root){
		String key;		
		if(root.getChildren() != null && root.getTestAttribute() != -1){
			assignLeaves(root.getChildren()[0]);
			assignLeaves(root.getChildren()[1]);
		}
		else{
			HashMap<String, Integer> counts = new HashMap<String, Integer>();
			ArrayList<ArrayList<String>> records = root.getRecords();
			TreeNode test = root.getParent();
			while(records.size() == 0){
				records = test.getRecords();
				test = test.getParent();
			}
			if(!records.isEmpty()){
				for(int j = 0; j<records.size(); j++){
					key = records.get(j).get(indexOfClassLabel);
					if(!counts.containsKey(key)){
						counts.put(key, 1);
					}
					else{
						counts.put(key, counts.get(key)+1);
					}
				}
				int maxValue = Collections.max(counts.values());
				int maxKey = -1;
				for(Entry<String, Integer> itr : counts.entrySet()){
					if(itr.getValue() == maxValue)
						maxKey = Integer.parseInt(itr.getKey()); 
				}
				root.setLeafAttribute(Integer.toString(maxKey));
				root.setLeaf();
			}
			else{
				root.setLeaf();
			}
		}
		return;	
	}