Given a linked list handling string data, check to see whether data is palindrome or not?
Input : a -> bc -> d -> dcb -> a -> NULL Output : True String "abcddcba" is palindrome. Output : a -> bc -> d -> ba -> NULL Output : False String "abcdba" is not palindrome.
The idea is very simple. Construct a string out of given linked list and check if the constructed string is palindrome or not.
This article is contributed by Aditya Goel. Please write comments if you find anything incorrect, or you want to share more information about the topic discussed above
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Count of three non-overlapping sub-strings which on concatenation forms a palindrome
- Check if longest connected component forms a palindrome in undirected graph
- Check if a linked list is Circular Linked List
- Length of longest palindrome list in a linked list using O(1) extra space
- Function to check if a singly linked list is palindrome
- Check linked list with a loop is palindrome or not
- Check if a doubly linked list of characters is palindrome or not
- Count of pairs of strings whose concatenation forms a palindromic string
- XOR Linked List - A Memory Efficient Doubly Linked List | Set 1
- XOR Linked List – A Memory Efficient Doubly Linked List | Set 2
- Merge a linked list into another linked list at alternate positions
- Convert singly linked list into circular linked list
- Difference between Singly linked list and Doubly linked list
- Convert Singly Linked List to XOR Linked List
- Create new linked list from two given linked list with greater element at each node
- Sum of all Palindrome Numbers present in a Linked list
- Given two strings check which string makes a palindrome first
- Sentence Palindrome (Palindrome after removing spaces, dots, .. etc)
- Count all palindrome which is square of a palindrome
- Construct a Maximum Sum Linked List out of two Sorted Linked Lists having some Common nodes
Improved By : princiraj1992