I am trying to analyze the algorithm Product: multiply two n-bits binary numbers x and y.
function Product(x, y);
1. prod = 0;
2. while y not eq 0
3. y = y -1;
4. prod = prod + x;
return prod;
Assume: n = |x| = |y|
Give the worst case time T(n) function for algorithm Product.
Express T(n) in terms of a big-Θ function in n.
Analysis:
T(n) = c1 + n + c2 + c3
I would appreciate it if someone could explain how to use big-Θ to express T(n).
can't attach a PDF
You can use $L^AT_EX$. $\endgroup$