Skip to content

Instantly share code, notes, and snippets.

@paras062
paras062 / BSTDeletion_CPP.cpp
Last active January 29, 2020 05:31 — forked from mycodeschool/BSTDeletion_CPP.cpp
Added case to delete the root node of the BST, Modified function FindMin to handle deletion from both right and left subtree. Added flag variable to judge if root node has to be deleted
/* Deleting a node from Binary search tree */
#include<iostream>
using namespace std;
struct Node {
int data;
struct Node *left;
struct Node *right;
};
//Function to find minimum in a tree.
// Changes by Paras Starts