$$T(n) = T\left(\frac{n}{2}\right) + T\left(\frac{n}{4}\right) + T\left(\frac{n}{8}\right) + n$$
How do you solve this recurrence?
$$T(n) = T\left(\frac{n}{2}\right) + T\left(\frac{n}{4}\right) + T\left(\frac{n}{8}\right) + n$$
How do you solve this recurrence?
It will be $\Theta(n)$, to save myself from rewriting an entire answer, I will refer you to this question and you can apply the answer to your question.
Because in each recurrence you are cutting $n$ by half you will have at most $log(n)$ calls, if you use memorization, memorization will make your code faster because you will avoid overlapping calls, because $T(n/4) = T(n/2/2)$.
If $n$ is small number and you can use normall array for storing the values the complexity will be $O(\log n)$, but if n is big (up to $10^{18}$) then you can optimaze by using some data structures (map in c++) to make the complexity $O((\log n)^2)$