Solve $T(n)=T(n-2)+\frac{1}{\log(n)}$ for $T(n)$.
I am getting the answer as $O(n)$ by treating $1/\log(n)$ as $O(1)$. The recursive call tree of this is a lop-sided tree of height $n$. Hence, considering the amount of work done in each step, the answer comes out to be $O(n)$. Please verify my answer, and tell me if I am correct.
$T(n)=T(n-2)+\frac{1}{\log(n)}$
$\implies T(n-2)=T(n-4)+\frac{1}{log(n)}+\frac{1}{\log(n-2)}$
So, $T(n) = T(n-2r)+\sum_{0≤2s<2r}\frac{1}{\log(n-2s)}$
If $n$ is even, $2r\leq n-2$, $T(n) = T(2)+\sum_{0≤2s<n-2}\frac{1}{\log(n-2s)}$
If $n$ is even, $2r\leq n-1$, $T(n) = T(1)+\sum_{0≤2s<n-1}\frac{1}{\log(n-2s)}$
In either cases, $O(n) = \frac{n}{\log(n)}$