Question: Subject Passing array as argument allow the function to modify argument array. Pointer notion in place of array index notation Specification Write an ANSI-C program

 Subject Passing array as argument allow the function to modify argumentarray. Pointer notion in place of array index notation Specification Write an

Subject Passing array as argument allow the function to modify argument array. Pointer notion in place of array index notation Specification Write an ANSI-C program that reads inputs line by line, and sorts each line of input alphabetically, according to the indexes of the characters in ASCII table, in ascending order. That is, the letter that appear earlier in the ASCII table should appear earlier in the sorted array. The program terminates when quit is read in Implementation Assume that each line of input contains at most 30 characters and may contain blanks Use fgets to read line by line Define a function void sortArray (char *) which sorts characters in the argument array according to the index in the ASCII table Do not use extra arrays. sortArry should sort and modify the argument array directly Do not use array indexing [] throughout the program, except for array declarations in main Instead, use pointers and pointer arithmetic to manipulate arrays Do not use global variables. People have been investigating sorting problems for centuries and there exist various sorting algorithms, so don't try to invent a new one. Instead, you can implement any one of the existing sorting algorithms, e.g., Bubble Sort, Insertion Sort, Selection Sort. (Compared against other sorting algorithms such as Quick Sort, Merge Sort, these algorithms are simpler but slower (n2) complexity). Pseudo-code for Selection Sort is given below for you SELECTION-SORT(A) 0. n number of elements in A 1. for i-0 to n-1 2. 3. 4 smallest-i I/ smallest: index of current smallest, initially i forj-i+ to n ifA[j ]

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 Databases Questions!