I wish to delete the leftmost leaf in a BT( not BST!). I tried to delete it using Reverse level order traversal but once I find the leftmost node and delete it and try returning, I cannot handle the extra recursive calls. Basically with the current code, my entire tree gets deleted recursively, but I just want it to delete leftmost leaf.

I tried breaking the recursion using exit() and my entire program stopped.

![ex_of_BT](https://i.stack.imgur.com/NHkui.png)

On first call only 5 should be deleted. On next call 25 should be deleted . On next call 66 should be deleted.( basically swimming up)

This is what my code looks like:

```
def del_leaf(node):
    if(root==None):
        return

    if root:
        # First recur on left child
        del_leaf(root.left)

        # the recur on right child
        del_leaf(root.right)

        # now print the data of node
        if ( (root.isvisited == False)):
            root.isvisited = True
            root.left = None
            root.right = None
            return

```