text: Threaded Binary Search Tree | Deletion | Here ' par ' is pointer to parent Node and ' ptr ' is pointer to current Node . ; If Node to be deleted is root ; If Node to be deleted is left of its parent
code: struct Node * caseA ( struct Node * root , struct Node * par , struct Node * ptr ) { if ( par == NULL ) root = NULL ; else if ( ptr == par -> left ) { par -> lthread = true ; par -> left = ptr -> left ; } else { par -> rthread = true ; par -> right = ptr -> right ; } free ( ptr ) ; return root ; }