#include <stdio.h>
#include <stdlib.h>
int max (int A[], int c, int d);
int main (void)
{
int i = 0;
int j = 0;
int A[3] = {-95,52,3};
int B[3][3];
for( i = 0; i < 3; i++)
{
for(j = 0; j < 3; j++)
{
if(j < i)
{
B[i][j] = 0;
}
else
{
B[i][j] = max(A,i,j);
}
}
}
}
int max(int A[],int c,int d)
{
int i = 0;
int j = 0;
int max = -100;
for (i=c; i <= d; i++)
{
if(max < A[i])
{
max = A[i];
}
}
return max;
}
I don't understand how to compute complexities. I think this is in n^2 but I don't know why it would be.
This program takes a single array and creates a double array based on the max from i to j. The output is correct.

max.O(n²)time the complexity of themax(), so it is in totalO(n³)