This question already has an answer here:
Hi I know two nested for loops will have time Complexity of O(n²). However let's say first loop starts from 0 and goes upto variable X max value(suppose x is n) and second loop starts from +1 of the first loop then we woudn't compare all the values of x with all the other values of x.In that case it woudn't be n². In that case +1 method cannot be O(n²) right? So what is it? Thanks.