The insertion sort is easier to understand and to program than the merge sort. The merge sort is far more efficient [O(n log n)] than the insertion sort [O(n2)].

What will be an ideal response?


In a sense, it does not really sort these two subarrays. It simply keeps splitting the original array in half until it provides a one-element subarray, which is, of course, sorted. It then builds up the original two subarrays by merging these one-element ar- rays to form larger subarrays, which are then merged, and so on.

Computer Science & Information Technology

You might also like to view...

Specifying a port that is already in use or specifying an invalid port number when creating a DatagramSocket results in a __________.

a. SocketException. b. PortInUseException. c. PortException. d. ConnectException.

Computer Science & Information Technology

The broadening of a pulse due to the different path lengths taken through the fiber by different modes is called

a. chromatic dispersion. b. polarization mode dispersion. c. modal dispersion. d. diffusion

Computer Science & Information Technology

You can select the destination medium for style information using the ____ attribute with the