Average run time for the case for(;;)

hi All,

Say we have a loop that goes something like this:

for(;;)

        while(i < n)

                  i++;

        while(j < m)

                  j++;

        if(i < j)

               break;

The worst time is anyway O(n-squared). How would you calculate the average run time

thanks

Sesh




Answer this question

Average run time for the case for(;;)

  • Average run time for the case for(;;)