C POGRAM The objective is to be able to implement sorting algorithms to sort a sequence of numbers.  1. Make a code for a program that follows the details in the PROGRAM SPECIFICATION section. 2. Develop a program following the structured programming approach at the very least. No global variable declarations are allowed.  PROGRAM SPECIFICATION  Write a program that implements three specified sorting algorithms and use each to sort an array of numbers. The sorting algorithms you are to implement are: SELECTION, MERGE, and RADIX.  Your program should have the following main menu:  Sorting Demonstration  [1] Input array  [2] Display array  [3] Perform SELECTION SORT  [4] Perform MERGE SORT  [5] Perform RADIX SORT  [0] Exit  Enter choice:  Details of the menu items are as follows:  Input array: Once selected, the user is asked for the size of the array and the numbers to be stored to the array. Note: you are to implement a dynamic array to accommodate varying array sizes.  Display array: Once selected, the program should display the content of the original input array.  Perform SELECTION SORT: Once selected, the program should apply the selection sort algorithm to sort the array elements. For each time the array is updated (there is a change in the positioning of some elements) by the selection sort process, the program should print the updated array. This is to keep track and determine how sorting is done using the algorithm. The program should also display at the end of the process the time it took for the algorithm to sort the array elements.  Perform MERGE SORT: The function of this menu item should be the same as that of menu item [3] except that merge sort is used instead of selection sort.  Perform RADIX SORT: The function of this menu item should be the same as that of menu item [3] except that radix sort is used instead of selection sort.  Exit: Once selected, the program should terminate with a message informing the user that the program has ended.  Important:  1. Each sorting process should not modify the original array.  2. If the process is to be performed on an empty array, simply inform the user that the process cannot be done because the array is empty.  3. At the end of each process, the program should display a message appropriate to the result of the process.  4. After processing the selected main menu item, the program should loop back to the main menu. The program should end only when the user selects the main menu item Exit.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

C POGRAM

The objective is to be able to implement sorting algorithms to sort a sequence of numbers. 

1. Make a code for a program that follows the details in the PROGRAM SPECIFICATION section.
2. Develop a program following the structured programming approach at the very least. No global variable declarations are allowed. 

PROGRAM SPECIFICATION 
Write a program that implements three specified sorting algorithms and use each to sort an array of numbers. The sorting algorithms you are to implement are: SELECTION, MERGE, and RADIX. 

Your program should have the following main menu: 

Sorting Demonstration 

[1] Input array 
[2] Display array 
[3] Perform SELECTION SORT 
[4] Perform MERGE SORT 
[5] Perform RADIX SORT 
[0] Exit 

Enter choice: 


Details of the menu items are as follows: 

Input array: Once selected, the user is asked for the size of the array and the numbers to be stored to the array. Note: you are to implement a dynamic array to accommodate varying array sizes. 

Display array: Once selected, the program should display the content of the original input array. 

Perform SELECTION SORT: Once selected, the program should apply the selection sort algorithm to sort the array elements. For each time the array is updated (there is a change in the positioning of some elements) by the selection sort process, the program should print the updated array. This is to keep track and determine how sorting is done using the algorithm. The program should also display at the end of the process the time it took for the algorithm to sort the array elements. 

Perform MERGE SORT: The function of this menu item should be the same as that of menu item [3] except that merge sort is used instead of selection sort. 

Perform RADIX SORT: The function of this menu item should be the same as that of menu item [3] except that radix sort is used instead of selection sort. 

Exit: Once selected, the program should terminate with a message informing the user that the program has ended. 

Important: 
1. Each sorting process should not modify the original array. 

2. If the process is to be performed on an empty array, simply inform the user that the process cannot be done because the array is empty. 

3. At the end of each process, the program should display a message appropriate to the result of the process. 

4. After processing the selected main menu item, the program should loop back to the main menu. The program should end only when the user selects the main menu item Exit.

Expert Solution
steps

Step by step

Solved in 3 steps with 5 images

Blurred answer
Knowledge Booster
Declaring and Defining the Function
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-engineering and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY