Question: Question 5 2 0 pts Write a segment of code that implements a functions called doSomething ( ) that takes in a list of words

Question 5
20 pts
Write a segment of code that implements a functions called doSomething () that takes in a list of words (1ist), a string (stx), and the number of words ( n ) in list as arguments, and implements the logic described below.
dosomething () searches for str in list and returns A NEW LIST containing all the words in list spelled backwards with the exception of the found string. If str is not found in list, then the NEW LIST is the same as list.
For instance, if list contains ["ABC", "DEF", "GHI", "JKL"] and str is "DEF", then the function returns a new list containing ["CBA", "DEF", "IHG", "LKJ"], and if str is not found in list, then the function returns a new list containing ["ABC", "DEF", "GHI", "JKL"](same as the original list).
Note:
You MUST NOT modify the contents of list, nor can you use strcmp () or strcpy (). However, you CAN use strlen().
You MUST NOT use any array notation, i.e.[].
You MAY NOT assume each word in 1ist is the same length.
You may assume at most a SINGLE OCCURENCE of st r in list:
You may assume the call to the dosomething () function is made elsewhere in the code. More precisely, provide the code segment that will go in the place indicated below.
chart* dosomething (char** list, char* str, int n){
// Your code segment below goes here
Question 5 2 0 pts Write a segment of code that

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!