Arithmetic Time Shift Shift

What is time complexity : * Arithmetic left shift * / * Arithmetic right shift * of the n-bit operand operators, for example, doing x = y <<2; who needs it?

+1


source to share


1 answer


The complexity with notation O (...) is an asymptotic characteristic of the time that the algorithm takes as the input size gets larger and larger. This doesn't make sense for algorithms that can only accept a finite number of inputs. <<

can take 2 ^ 32 * 32 different inputs, hence a finite number of inputs, so it is constant time (O (1)).



+3


source







All Articles