Question: CS 2 4 0 HOMEWORK 4 Write a C program that meets the following requirements: Input: There are 2 lines of input: - First line:

CS240 HOMEWORK 4 Write a C program that meets the following requirements: Input: There are 2 lines of input: - First line: the list of integers S = S1,S2,S3...Sn (n<10000). Each integer is in the range of [-100000,100000](can be positive, negative or zero)- Second line: an integer X Output: The program will 1. Read from stdin and save list S into a linked list. 2. Remove all nodes in the list where the values are less than X.3. Sort the remaining list in ascending order Finally, print 2 lines into stdout: 1. The sorted list of integer, each integer is separate by comma ,2. The original index of the sorted integers, separate by comma , If no integers remain after filtering, print nothing into stdout. Note: - If two numbers are the same, the smaller index will appear first. - Please use a linked list to store and process the integers, you CANNOT use arrays. SAMPLE INPUT 110,20,0,-10 SAMPLE OUTPUT 10,10,202,0,1 SAMPLE INPUT 2-1,-2,-3,-4,1,4,3,2-1 SAMPLE OUTPUT 2-1,1,2,3,40,4,7,6,5 SAMPLE INPUT 3-1000,-21,-37,-490 SAMPLE OUTPUT 3

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!