Not able to figure out the error

I have written code to print the tree from the given input of true false sequence, but my code prints only one node. Stuck from 2 days please help.