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, 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. 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. 1
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
