Find the order of the function(recurrence)

37 Views Asked by At

I am trying to find the order of the following recurrence: $Q\left(1\right)\:=\:1\:$; $Q\left(n\right)\:=\:Q\left(\lfloor\frac{n}{2}\rfloor\right), n > 1$.

From what I can tell the value of this function is always $Q\left(1\right)\:=\:1$, because we will always have the following: $Q\left(n\right)\:=\:Q\left(\lfloor\frac{n}{2}\rfloor\right) = Q\left(\lfloor\frac{n}{2^2}\rfloor\right) = Q\left(\lfloor\frac{n}{2^3}\rfloor\right) = ... =Q\left(1\right)\:=\:1$. So the order is $\Theta(1)$

Am I correct or maybe I am missing something ?

1

There are 1 best solutions below

2
On BEST ANSWER

From what you wrote, you aren't missing anything. The function is actually equal to $Q(x)=1$.

However, if I were you, I'd double check if you didn't miss something from the definition of $Q$.