how to implement the function delete of binary Search tree without recursivity in c language ? :  Hello everybody i try to implement the delete method but that doesn't work 
 with me , the function has tree type of "struct tree" as a parameter so i can't use recurisivity, i want to do it with a loop. 
  
  that's my structure
        
        typedef struct Node Node;
        struct Node{
        	const void* data;
        	const void* value; 
        	Node* left;
        	Node* right;
        };
         
        typedef struct Tree Tree;
        struct Tree{
        	Node* root;
        	size_t size;
        	int (*comp)(const void *, const void *);
        };

function delete 
        void freeTree(Tree* tree, bool TreeContent){
            if(tree->root != NULL){
                
                // free(tree->root->left);
                // free(tree->root->right);
                // free(tree->root);
            }
        }              

function insert        

    bool insertInTree(Tree* bst, const void* key, const void* value){
        if(bst->root == NULL){
                Node* newNode = (Node*) malloc(sizeof(Node));
                if(newNode == NULL){
                       printf("erreur d'allocation dynamique \n");
                       exit(1);
                }
                newNode->left =  newNode->right = NULL;
                newNode->value = value;
                newNode->data = key;
                return true;
        }
        else{
                int isLeft = 0 ;
                Node* Current = bst->root ;
                Node* precedant = NULL;
                while(Current != NULL){
                    int compare = bst->comp(&Current->data , &key);
                    precedant = Current;
                if(compare == 1){
                       isLeft = 1;
                       Current = Current->left;
                }
                else if(compare == 0){
                        isLeft = 0;
                        Current = Current->right;
                }
    
                }
                if(isLeft == 1){
                        Node* newNode = (Node*) malloc(sizeof(Node));
                        if(newNode == NULL){
                                           printf("erreur d'allocation dynamique \n");
                                           exit(1);
                        }
                        newNode->left =  newNode->right = NULL;
                        newNode->value = value;
                        newNode->data = key;
                        precedant->left = newNode;
                        bst->size++;
                        return true;
                        }
                else{
                        Node* newNode = (Node*) malloc(sizeof(Node));
                        if(newNode == NULL){
                                           printf("erreur d'allocation dynamique \n");
                                           exit(1);
                        }
    
                        newNode->left =  newNode->right = NULL;
                        newNode->value = value;
                        newNode->data = key;
                        precedant->right = newNode;
                        bst->size++;
                        return true;
    
                }
    
            }
            return false;
    }


         

