Given the fact that a selection sort of n items requires n2/2 + 5 * n/2 – 3 major operations, the selection sort is ______.

a. O(1)
b. O(n)
c. O(n2)
d. O(log2 n)


c. O(n2)

Computer Science & Information Technology

You might also like to view...

Redesign the registration transaction in the Student Registration System design as a multilevel transaction.

What will be an ideal response?

Computer Science & Information Technology

____________________ stores the data being processed and the resulting information.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

Consider the following code:

MOV r0,#Vector ;point to Vector
MOV r2,#10 ;loop count
Loop LDR r1,[r0] ;Repeat: get element
SUBS r2,r2,#1 ;decrement loop count and set Z flag
MUL r1,r1,#5
STR r1,[r0] ;save result
ADD r0,r0,#4 ;point to next
BNE Loop ;until all done (branch on Z flag).
Suppose this ARM?like code is executed on a 4?stage pipeline with internal forwarding. The load instruction has one cycle penalty and the multiply instruction introduces two stall cycles into the execute phase. Assume the taken branch has no penalty. a. How many instructions are executed by this code? b. Draw a timing diagram for the first iteration showing stalls. Assume internal forwarding. c. How many cycles does it take to execute this code?

Computer Science & Information Technology

What is a linear implementation?

What will be an ideal response?

Computer Science & Information Technology