3 ms·
for (i = 0; i <= n-1; i++) for (i = n-1; i >= 0; i--)
by torstenvl 2y ago
for (i = 0; i <= n-1; i++)
for (i = n-1; i >= 0; i--)
- trealira 2y agoYeah, that way of writing them definitely makes them look more symmetric. You could also do this, though it's a bit less pretty: for (i = -1; ++i != n; ) for (i = n; --i != -1; )