CantLoseNow's blog

By CantLoseNow, history, 18 months ago, In English

i was seeing a solution of my question and i encountered this statement — "since we need to do some deletions here, we cant use vectors, since its not directly possible in vectors." my question is that dont we have the erase() function in vectors? then why not use it?

  • Vote: I like it
  • +15
  • Vote: I do not like it

»
18 months ago, # |
  Vote: I like it +14 Vote: I do not like it

Because erase() function is too slow. It has a complexity of $$$O(size)$$$