hello,
i have a problem in understanding time complexity.
i know that if we are having on for loop. for e.g.
for(int i=0.i<n;i++)
{
}
then my time complexity will be O(n).
And if i nest two for loops ,like this
for (int i=0;i<n-1;i++)
{
for(int j=i;j<n;j++)
{
}
}
time complexity will be O(n^2).
My question is what if my function has two for loops one after another like this:
for(int i=0;i<n;i++)
{
}
for(int j=0;j<n;j++)
{
}
then what will be time complexity of my whole code now?
Please explain!!!