Amazon Interview Question

Write the code to remove half nodes in a binary tree?