Assuming we have two integers a and b, if we do bitwise operations like a & b or a | b, is the running time O(1) (constant) or is it O(b) where b is the number of bits in a and b? Thanks!

  • 1
    $\begingroup$ This will depend on the model of computation. $\endgroup$
    – Juho
    Oct 15, 2015 at 9:47
  • $\begingroup$ Thanks for your answer. What do you mean by the model of computation? $\endgroup$
    – programmer
    Oct 15, 2015 at 9:50


Browse other questions tagged or ask your own question.