_Muhammad's blog

By _Muhammad, history, 6 years ago, In English
bitset < n > b1, b2;
b1 |= b2;

Is the complexity of above code O(n)? Or it works in O(1).

  • Vote: I like it
  • -10
  • Vote: I do not like it

»
6 years ago, # |
  Vote: I like it +6 Vote: I do not like it

It works in approximately O(n / 64), but your n is a constant, so it works in O(1) :D