Recursive Depth First Search Algorithm to Delete Leaves With a Given Value in a Binary Tree

Given a binary tree root and an integer target, delete all the leaf nodes with value target. Note that once you delete a leaf node with value target, if …