c - What is the complexity of the following simple program? -


i having trouble finding understanding complexity. me understand complexity of code below , why.

for (int = 1; < n; i++) { // (n number chosen user)     (int j = - 1; j >= 0; j--) {         printf("i=%d, j=%d", i, j);     } } 

an explanation great.

assuming starts @ 0, complexity constant. complexity expressed relative variable defining number of executions, not case here.

if 1 term should used describe behavior, "constant". there number of executions, number never change


Comments

Popular posts from this blog

How to check data type in C++? -

javascript - Is getTimezoneOffset() stable during daylight saving transition? -

formula - R: how to pass in a reference to the variable in glm or lm? -