Basic op not mentioned


#1

if we consider comparison as a basic operation,then the complexity is O(n^2),is it not?


#2

The comparison is considered a basic (O(1)) operation. Notice that both i and j only increase through the array, this is why the complexity is linear.