If root is a leaf node and it 's level is less than k then  remove this node.  This goes up and check for the ancestor nodes also for the  same condition till it finds a node which is a part of other  path(s) too.
if ( root -> left == NULL && root -> right == NULL && level < k ) { delete root ; return NULL ; }