Question: Write a program that takes input a list of numbers from the user, prints first unordered list and then the ordered list. Commented [ AU

Write a program that takes input a list of numbers from the user, prints first unordered list and then the ordered list.
Commented [AU23]:
a. Program should first ask the total numbers the user want to enter. As an example, user entered 5.
b. Program then takes 5 numbers as input in a sequence i.e., one after another.
c. Program then prints two lists.
i. First list is the exact sequence in which user entered the numbers.
ii. Second list is the sorted list in increasing order from the smallest to largest. This can be achieved by using ordered insertion while user inputs the number.
d. You are required to create a function that sorts the list using ordered insertion. Ensure it has required input and output parameters.
For example, if user entered 5 and input the following numbers 5,3,6,8,7.
Program should print:
User sequence: 53678
Sorted sequence: 35678

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!