Microsoft interview question

Print a tree on given criterion