check out stack overflow link

http://stackoverflow.com/questions/4965335/how-to-print-binary-tree-diagram