CantLoseNow's blog

By CantLoseNow, history, 2 years 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

»
2 years 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)$$$