This homework is not graded. It is practice for the Quiz 4.
Show the comparisions and exchanges made by the bad sorts, selection and insertion, on the following input set of six values:
Show how quicksort will partition the following array of nine values into two parts. Show the exchanges and comparisions made in the partitioning. You may choose the pivot.
Show how the good sorts, heapsort and mergesort, will sort the following list of eight values.
A file contains a sequence of integers, possibly separated by
commas. Write a C++ subroutine which is passed an istream
that has been opened to this file and returns the sum of all the
integers in the file. Return -1 is the file is not in the correct
format.
Here is an example of the file input:
35 67, 89 13 5 13, 67
Here is a header for your function:
int SumEm(istream NumS)
Write some C++ statements to replace the fifth character of a file with the character 'X'.