In the text, we say that after the merge sort splits the vector into two subvectors, it then sorts these two subvectors and merges them. Why might someone be puzzled by our statement that “it then sorts these two subvectors”?

What will be an ideal response?


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

Computer Science & Information Technology

You might also like to view...

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

1. A template class allows the class to be used with different data types. 2. Definitions of member functions cannot be placed inside the class definition. 3. When using the indexed list class it is not possible to overwrite data outside the list if you use a subscript that is too large. 4. An indexed list is a collection of data items of different types. 5. In the indexList template class, the member function append, which adds an element to the end of the list, has two parameters.

Computer Science & Information Technology

Write a void function called copy_to_screen that copies the contents of a file to the screen. The argument of the function is an ifstream object. Preconditions and postconditions follow: Preconditions: The stream argument for the function has been connected to a file with a call to the member function open. Postcondition: The contents of the file connected to the ifstream argument have been copied to the screen so that the screen is the same as the contents of the file. This function does not close the file.

What will be an ideal response?

Computer Science & Information Technology

File ____ correspond to file ____.

A. names; extensions B. extensions; properties C. types; extensions D. names; types

Computer Science & Information Technology

When text wrapping is set to something other than ________, the object will be anchored to a paragraph

A) Top and Bottom B) In Line with Text C) Square D) Tight

Computer Science & Information Technology