Cognizant Interview Question

I was asked to write code for Binary Tree.