Easy way to calculate time complexity
Using the example below for illustration
void f(int n)
{
int i;
int j;
for (i = 0; i < n; i++)
{
if (i % 2 == 0)
{
for (j = 1; j < n; j = j * 2)
{
printf("[%d] [%d]\n", i, j);
...
snowcodes.hashnode.dev5 min read