I am trying to determine if a word is a palindrome or not using queues, but I am receiving the wrong results. I have tried several things to get it to work using the boolean variable isPalin. Will someone lead me to the right direction please? I have been trying for hours, and I feel that it is something small that is holding me back.
Current Output:
mom is a Palindrome
cat is a Palindrome
noon is a Palindrome
mouse is a Palindrome
Expected Output
mom is a Palindrome
cat is NOT a Palindrome
noon is a Palindrome
mouse is NOT a Palindrome
It seems to me that you are over complicating things. Wouldn't it be a lot simpler to just use a double ended queue, otherwise known as a deque?
Modifying your code from one of your previous posts in another thread:
I have a question...If I decide to use my queue.h, will I be able to accomplish the same thing? or is it no way that I can determine a palindrome with what I have?
Oh I see you've HAD to implement your own queue class as a part of your assignment...sorry I thought you were just over complicating things for yourself.
In that case, to turn your class into a double ended queue I guess you'd need to implement a function to allow the removal of items from the back of the queue, something like this perhaps?
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.