AMORTIZED1

What is the time complexity of the following code :

        int j = 0;
        for(int i = 0; i < n; ++i) {
            while(j < n && arr[i] < arr[j]) {
                j++;
            }
        }
Sign Up
to access hints and editorial solutions for AMORTIZED1
57105 successful submissions.
Click here to start solving coding interview questions