I am very much confuse that why complexity of this program is O(n)?
int j = 0;
int i;
For (i = 0; i < n, i++) // O(n)
{
For (i = 0; i < n, i++)//O(n)
{
While (j < n)// O(n)
{
Statement; j++;
}
}
}
I am totally new to Algorithms. Any help and explanation will be appreciated.