Question
c++ using stacks. Supposed to get a string and push it through a stack, and then compare, if symmetrical then return true. So for instance,
c++ using stacks. Supposed to get a string and push it through a stack, and then compare, if symmetrical then return true. So for instance, abccba would be true. pabccba would be false. Program mostly works but I am stuck on a bug. Help with a fix would be greatly appreciated. The problem I am having is that if I put any two letters, it will return true. Even if the string is not symmetrical. such as 'ab' will return true when it should be false. only 'aa' and strings that are symmetrical should return true. Not sure if it's the checking in the for loop is the problem, or if it needs an if statement somehwere.
source: https://pastebin.com/2T333VMZ
header: https://pastebin.com/sEiKG0mK
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started