public void writeByLevel(TreeNode root)
	{
		Queue<TreeNode> queue = new LinkedList<TreeNode>();
		
		queue.add(root);
		
		while(!queue.isEmpty())
		{
			TreeNode curNode = queue.remove();
			
			if(curNode == null)
			{
				out.print("# ");
			}
			else
			{
				out.print(curNode.getValue() + " ");
				queue.add(curNode.getLeft());
				queue.add(curNode.getRight());
			}		
		}
	}