Yes the problem was with the pointer of the node above the one being deleted. Thanks for pointing :) that out. So I had to check while remaining on the node above the one being deleted if the...
Type: Posts; User: Sergiu Nistor
Yes the problem was with the pointer of the node above the one being deleted. Thanks for pointing :) that out. So I had to check while remaining on the node above the one being deleted if the...
The BST is not balanced, the first number entered is the root and the rest are inserted accordingly (smaller to the left, bigger to the right) so when BST is 4,3,2,1 4 is the root and every other...
In a BST with 1,2,3 the function should delete 1(root). The problem seems to be in the else block. If I make a BST with 4,3,2,1 t is on node 1 when it reaches the else block and the program crashes...
struct node
{ int data;
struct node* left;
struct node* right;
};
in main i create struct node* root, and insert other nodes, after this I apply this function to root:
void...