Question: Problem 1 Consider a sentence stored as a singly linked list, where each node consists of a word (of type string). E.g., the sentence How

 Problem 1 Consider a sentence stored as a singly linked list,

Problem 1 Consider a sentence stored as a singly linked list, where each node consists of a word (of type string). E.g., the sentence "How are you" is stored in three linked list nodes, each containing the words "How", "are", and "you". Node containing "How" is the head of the linked list with next pointing to the node containing "are" and so on. Node containing "you" is the tail node. 1. Write a pseudocode using recursion to reverse such a sentence word by word. E.g., if the input sentence is "A quick brown fox jumps over the lazy dog", the output needs to be "dog lazy the over jumps fox brown quick A". Put your pseudocode, including all your sources, in a file called recursiveReversewords.pdf. You cannot make the linked list doubly linked. 2. Implement your pseudocode. You are provided a file called recursiveReverseWords.cpp with a main function and the function declaration. Do not change the function declaration. The input parameter and return types must be as specified. You will need to include your implementation in this file. The main function includes some test cases. In a separate file called LinkedList.h, you will find the template declaration for a linked list with the basic functionalities implemented. For bonus points, implement a function that checks if the element you insert into the linked list is a word (ie., does not contain special characters or white spaces) Problem 1 Consider a sentence stored as a singly linked list, where each node consists of a word (of type string). E.g., the sentence "How are you" is stored in three linked list nodes, each containing the words "How", "are", and "you". Node containing "How" is the head of the linked list with next pointing to the node containing "are" and so on. Node containing "you" is the tail node. 1. Write a pseudocode using recursion to reverse such a sentence word by word. E.g., if the input sentence is "A quick brown fox jumps over the lazy dog", the output needs to be "dog lazy the over jumps fox brown quick A". Put your pseudocode, including all your sources, in a file called recursiveReversewords.pdf. You cannot make the linked list doubly linked. 2. Implement your pseudocode. You are provided a file called recursiveReverseWords.cpp with a main function and the function declaration. Do not change the function declaration. The input parameter and return types must be as specified. You will need to include your implementation in this file. The main function includes some test cases. In a separate file called LinkedList.h, you will find the template declaration for a linked list with the basic functionalities implemented. For bonus points, implement a function that checks if the element you insert into the linked list is a word (ie., does not contain special characters or white spaces)

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!