Given a linked list of strings, we need to reverse each word of the string in the given linked list.
Input: geeksforgeeks a computer science portal for geeks Output: skeegrofskeeg a retupmoc ecneics latrop rof skeeg Input: Publish your own articles on geeksforgeeks Output: hsilbuP ruoy nwo selcitra no skeegrofskeeg
Using a loop iterate the list till null and take string from each node and reverse the string.
List before reverse: Geeksforgeeks a computer science portal for geeks List after reverse: skeegrofskeeG a retupmoc ecneics latrop rof skeeg
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above.
- Find if an array of strings can be chained to form a circle | Set 2
- Different methods to reverse a string in C/C++
- Sort an array of strings according to string lengths
- Camel case of a given sentence
- Remove characters from the first string which are present in the second string
- Count pairs in a binary tree whose sum is equal to a given value x
- Mu Sigma Interview On Campus
- Bank Of America (BA Continuum India Pvt. Ltd.) Campus Recruitment
- Bubble Sort On Doubly Linked List
- Reverse nodes of a linked list without affecting the special characters