logo

Crowdly

What is the space complexity (BigO) of this algorithm? Note: the algorithm is de...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

What is the space complexity (BigO) of this algorithm?

Note: the algorithm is described in pseudo-code. The input array arr is an array of size 40

In your calculation, do NOT consider the space used by the input array.

bubbleSort(arr)

    n <- arr.length

    for i from 0 to n - 1

        for j from 0 to n - i - 1

            if arr[j] > arr[j + 1]

                swap(arr[j], arr[j + 1])

0%
0%
0%
0%
0%
More questions like this

Want instant access to all verified answers on cyberlearn.hes-so.ch?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!