Skip to content

Commit

Permalink
Merge pull request #3 from SyedMIrtazaHyder/main
Browse files Browse the repository at this point in the history
  • Loading branch information
zarif98sjs authored Aug 26, 2024
2 parents b90e118 + 7a0a8aa commit 0028c7d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -424,15 +424,14 @@ Node* __delete(Node *node,int data,bool &ok)

if(red(node)) /// the node is red => just delete it
{
free(node);
ok = true;
}
else if(red(temp)) /// only child is red => replace with that red child and recolor black . so , black balance restored
{
temp->color = BLACK;
free(node);
ok = true;
}
free(node);

return temp;
}
Expand Down

0 comments on commit 0028c7d

Please sign in to comment.