By _Muhammad, history, 15 months ago, ,
bitset < n > b1, b2;
b1 |= b2;


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

• -10

 » 15 months ago, # |   +6 It works in approximately O(n / 64), but your n is a constant, so it works in O(1) :D
•  » » 15 months ago, # ^ |   -8 Thanks. But clear it little bit. if n = 1e3;then complexity O ( 1000/64 ) Or O ( 1 )
•  » » » 15 months ago, # ^ |   0 https://en.wikipedia.org/wiki/Big_O_notation O(1000/64)=O(1)...
•  » » » » 15 months ago, # ^ |   +1 Ah! Thanks a lot sir.It's now clear.