The time complexity of the following equation would be θ(n) with the help of change of variables and masters theorem method in algorithm.
If you are talking about the answer the answer than I think you are asking wrong question as for the answer of the equation we have to give input "n". for the code for this algorithm in c language here is the code.
#include <stdio.h>
int fun(int n) {
if (n <= 2) {
return 1;
} else {
return fun(n / 2) + n;
}
}
int main() {
int n = 10; // Example value of n
int result = fun(n);
printf("Result: %d\n", result);
return 0;
}