An array of 4 elements is being sorted in ascending order using the insertion sort algorithm. How many comparisons will insertion sort perform if the array was originally sorted in descending order?

A) 2 comparisons
B) 4 comparisons
C) 6 comparisons
D) None of the above


C) 6 comparisons

Computer Science & Information Technology

You might also like to view...

A project is:

a. Not required in a CLX application b. The overall CLX application c. Contained in the task in a CLX application d. Continuously executed e. Executed based on the method chosen: continuous, event, time-based.

Computer Science & Information Technology

Which of the following statements is NOT true about GUI programs?

A. Every GUI program requires a window. B. Every window has a title, width, and height. C. All components are added directly to the GUI window. D. A layout must be created before components can be added to a content pane.

Computer Science & Information Technology

Health informatics is both a _________ as well as a(n) _____________.

- field of study; art - profession; practice - profession; discipline - discipline; field of study

Computer Science & Information Technology

EDCA provides "relative" QoS but cannot guarantee its service.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology