help needed with C program using a linked list to determine if a word is a palindrome
Expand Post »
Hi,
i'm new to C programming and i could use some help with an assignment. i would like to store a word in a linked list, with each letter of the word in a separate node of the linked list. i would then like to traverse the linked list to check whether the word is a palindrome. the nodes in the palindrome should be double pointer nodes.
i'm not quite sure how to start here, any assistance will be appreciated.
Re: help needed with C program using a linked list to determine if a word is a palindrome
First you have to declare a structure that is each node. If you search for "linked lists" you will get lots of examples, such as this tutorial by Stanford University.
Re: help needed with C program using a linked list to determine if a word is a palindrome
First create a doubly link list. A doubly link list with each nodes having the address of next and previous node. The structure of the such node is as follows:
Re: help needed with C program using a linked list to determine if a word is a palindrome
thanks. each node is supposed to store one character of the entered word. the first and last letters of the word would then be compared and if the same, then the second would be compared to the second to last etc. what would be the best way to do this?
Either the thread starter or a moderator has marked this thread as solved. You can most likely trust the responses and answers given. There is most likely no reason for any further responses to be posted here. If you have a related question, please start a new thread in this forum instead.
This thread is more than three months old
No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.