Skip to content

Instantly share code, notes, and snippets.

@hsnice16
Created January 1, 2021 07:34
Show Gist options
  • Save hsnice16/fb475a4e4f4f03ed7293ad06fdb615ba to your computer and use it in GitHub Desktop.
Save hsnice16/fb475a4e4f4f03ed7293ad06fdb615ba to your computer and use it in GitHub Desktop.
// c++
if (curr->key > el) // curr is a variable maintaining current node(already present in tree)
// with which comparison is taking place
// And, el is new key we have to insert
{
successor = curr; // successor only contain value if new node
// goes in left subtree of curr node
curr = curr->left; // go left subtree
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment