Implement an update using [search if required +] delete + insert
1 - delete the key O (log n)
2 - insert a new node with the new key O (log n)
Even if you are first looking for the key, this is O (log n).
For more on RBT, see this page .
source
share