Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

10. What is meant by a feed rate?

Answered: 1 week ago