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
You might also like to view...
Public places where you can wirelessly connect to the Internet are known as ________
Fill in the blank(s) with correct word
A(n) ____ is one in which the condition is evaluated after the body of the loop.
A. infinite loop B. nested loop C. posttest loop D. pretest loop
What is the important distinction between the Audio Mixer panel and the Effect Controls panel?
What will be an ideal response?
A network administrator is concerned that the network is vulnerable to a denial-of-service attack. What steps should be taken to reduce this threat? (Select all that apply.)
A) Prevent intrusions. B) Configure the router to block directed broadcasts to the network. C) Set up a spoofing account so that the attacker doesn't know which machine to attack. D) Use access lists to allow only sources from the network to enter the router's interfaces. E) There isn't a way to reduce this threat.