I need an algorithm to multiply two numbers without using the multiply (*
) Operator and without using bitwise with complexity less than O(N) and I came up with the most obvious one which is
int m = 6, n = 5, sum = 0;
for(int i = 0, i<n, i++)
sum += m;
but this is O(N) which won't work for me.