The loop on line 1 tells us that the time complexity of insertion sort is at least:

```
1 for each j, from 1 to the length of A ā€“ 1
2 temp = A[ j ]
3 i = j ā€“ 1
4 while i is greater than -1 and A[ i ] is greater than temp
5 A[ i + 1 ] = A[ i ]
6 iā€”
7 A[ i + 1] = temp
```
A. O( 1 )
B. O( n )
C. O( lg n )
D. O( n2 )

B

Computer Science & Information Technology

You might also like to view...

In a network constructed using star topology, all the devices are connecting to one central device known as the:

A. router. B. repeater. C. hub. D. gateway

Computer Science & Information Technology

The following message is displayed when you attempt to log in with an incorrect username or an incorrect password: Login incorrect This message does not indicate whether your username, your password, or both are invalid. Why does it not tell you this information?

What will be an ideal response?

Computer Science & Information Technology