Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer BST Deletion | Trees Part I
Data Structure & Algorithms PART I

bookBST Deletion

There are also some cases while deleting nodes from the tree:

  • Deleting the leaf node;
  • Deleting the node with 1 child;
  • Deleting the node with 2 children.

Deleting the leaf node

We may simple remove the leaf node without any crucial changes in the tree.

Deleting the node with 1 child:

  • Replace that node with its child node;

  • Remove the child node from its original position.

Deleting the node with 2 children:

  • Get the inorder successor of that node;

  • Replace the node with the inorder successor;

  • Remove the inorder successor from its original position.

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 7

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

Awesome!

Completion rate improved to 4.35

bookBST Deletion

Veeg om het menu te tonen

There are also some cases while deleting nodes from the tree:

  • Deleting the leaf node;
  • Deleting the node with 1 child;
  • Deleting the node with 2 children.

Deleting the leaf node

We may simple remove the leaf node without any crucial changes in the tree.

Deleting the node with 1 child:

  • Replace that node with its child node;

  • Remove the child node from its original position.

Deleting the node with 2 children:

  • Get the inorder successor of that node;

  • Replace the node with the inorder successor;

  • Remove the inorder successor from its original position.

Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 3. Hoofdstuk 7
some-alt