Solution to C - Binary trees