Doubt in time complexity of the following questions

1.void function(int n)
{
int count = 0;

     for (int i=0; i<n; i++) 
     for (int j=i; j< i*i; j++) 
         if (j%i == 0) 
         { 
            for (int k=0; k<j; k++) 
                 printf("*"); 
          } 
    } 

int gcd(int n, int m)
{
if (n%m ==0) return m;
if (n < m) swap(n, m);
while (m > 0)
{
n = n%m;
swap(n, m);
}
return n;
}

3.The running time of an algorithm is given by T(n) = T(n - 1) + T(n - 2) - T(n - 3), if n > 3 n, otherwise.

Hello @Rj.25

I am sharing with you a link to a pdf which contains the solutions to the questions.
// https://minio.codingblocks.com/amoeba/9c57ac97-ac20-4674-8046-6e7555e09008.pdf 1
Also refer below links for
Q1. Time complexity for code
Q2. Gcd time complexity

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.