Minor typo in index.md (#21529)

This commit is contained in:
Prashanth Thiagarajan
2018-11-11 03:33:00 +05:30
committed by nik
parent 2ddd45506f
commit f0640891a6

View File

@ -44,7 +44,7 @@ It is very similar to the search function. You again start at the root of the tr
There are 3 cases that can happen when you are trying to delete a node. If it has,
1. No subtree (no children): This one is the easiest one. You can simply just delete the node, without any additional actions required.
2. One subtree (one child): You have to make sure that after the node is deleted, its child is then connected to the deleted node's parent.
3. Two subtrees (two children): You have to find and replace the node you want to delete with its successor (the letfmost node in the right subtree).
3. Two subtrees (two children): You have to find and replace the node you want to delete with its successor (the leftfmost node in the right subtree).
The time complexity for creating a tree is `O(1)`. The time complexity for searching, inserting or deleting a node depends on the height of the tree `h`, so the worst case is `O(h)`.