Reference no: EM131788513
Add appropriate operations to the classes in Exercises 1-6 and implement them with functions. To test these classes, you should write driver programs as instructed in Programming Problems 1-6 at the end of this chapter.
For define the private portion of a class to model the given item.
1. A class Date for dates consisting of a month, day, and year
2. A class Phone Number for telephone numbers consisting of area code, local exchange, and number
3. A class Checker for the position of a checker on a board
4. A class Cartesian a Poi into for a point (x, y) in a Cartesian coordinate system
5. A class Pol AR Poi into for a point (r, 8) in a polar coordinate system
6. A class Card for cards in a deck of playing cards.
For each of Problems 1-6, write a driver program to test the given function.
1. The double-ended selection-sort functions in Exercise 4.
2. The Min-Max-Sort function in Exercise 5.
3. The recursive simple-selection-sort functions in Exercise 6.
4. The recursive bubble sort function in Exercise 7.
5. The Shell-sort functions in Exercise 12.
6. The tree sort functions in Exercise 14.
Exercise 4,
For trace the execution of radix sort using diagrams like those in the text for each of the following lists of integers:
29,778,11,352,233,710,783,812,165,106
Exercise 5
For trace the execution of radix sort using diagrams like those in the text for each of the following lists of integers:
38,399,892,389,683,400,937,406,316,5
Exercise 6,
For trace the execution of radix sort using diagrams like those in the text for each of the following lists of integers:
353,6,295,44,989,442,11,544,209,46
Exercise,
For trace the execution of radix sort using diagrams like those in the text for each of the following lists of integers:
8745,7438,15,12,8501,3642,8219,6152,369,6166,8583,7508,8717,8114,630
Exercise 12,
In the original list (with possibly several records between them). For a stable sorting scheme, Doe's record still comes before Smith's after the list is sorted. determine whether the sorting method is stable.
Quicksort
Exercise 14,
In the original list (with possibly several records between them). For a stable sorting scheme, Doe's record still comes before Smith's after the list is sorted. determine whether the sorting method is stable.
Natural merge sort