Doubt regarding time complexity of erase in multiset

Revision en1, by redcoder23, 2020-12-01 17:50:26

Can anyone help me out in finding how the time complexity of erase in multiset is amortized constant when we erase by passing iterator to element we want to erase. Like I am getting the point that we are directly providing iterator to the element but I am thinking that after deleting that element, we have to maintain the red black tree (multiset is internally implemented as red black tree) which will have time complexity greater O(1). Then how comes the time complexity to be amortized constant. Thanks in advance.

Tags time_complexity, multiset

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English redcoder23 2020-12-01 17:50:26 574 Initial revision (published)