I have to write a program that multiplies two unsigned ints w/o using the * operator. Simple really, but there is a constraint on the algorthm. Although a simple way to go is
I cannot do that. The algorithm must run in time log2(min(x,y). I am slightly confused about how to go about this.Code:for (int i = 0; i < small_int; i++) { product = product + large_int; }