private static void dfs(TreeNode root) {
		int maxDepth = 0;
		if (root == null) {
			return;
		}
		Stack<TreeNode> stack = new Stack<TreeNode>();
		HashMap<TreeNode, Integer> marked = new HashMap<TreeNode, Integer>();
		stack.push(root);
		int current = 0;
		marked.put(root, current);
		while (!stack.isEmpty()) {
			TreeNode node = stack.pop();
			//marked.put(node, current);
			System.out.println(node.val + ", " + marked.get(node));
			//if (node.left != null || node.right != null) {
			//	++current;
			//}
			if (node.left != null) {
				if (marked.get(node.left) == null) {
					stack.push(node.left);
					marked.put(node.left, marked.get(node) + 1);
				}
			}
			if (node.right != null) {
				if (marked.get(node.right) == null) {
					stack.push(node.right);
					marked.put(node.right, marked.get(node) + 1);
				}
			}
			if (node.left == null && node.right == null) { // this is a leaf
				// evaluate depth
				int depth = marked.get(node);
				if (depth > maxDepth) {
					maxDepth = depth;
				}
			}
		}
		System.out.println("max: " + maxDepth);
	}