New answers tagged


#include <bits/stdc++.h> using namespace std; struct Node { int data; struct Node* next; }; Node* removeLeadingZeros(struct Node* a) { if (a != NULL && a->data == 0) return removeLeadingZeros(a->next); else return a; } int getSize(struct Node* a) { int sz = 0; while (a != NULL) { a = a-&...


In a “loop program”, the maximum number of iterations for each loop needs to be calculated before the loop starts iterating. In your example that is not the case, so you can’t draw any conclusions that you can draw for “loop programs”.


Bounded loops terminate, unbounded (as in your example) don't necessarily terminate.

Top 50 recent answers are included