Function to delete given element in binary tree
static void delete ( Node root , int key ) { if ( root == null ) return ; if ( root . left == null && root . right == null ) { if ( root . key == key ) { root = null ; return ; } else return ; } Queue < Node > q = new LinkedList < Node > ( ) ; q . add ( root ) ; Node temp = null , keyNode = null ;