cplusplus
.com
TUTORIALS
REFERENCE
ARTICLES
FORUM
C++
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs
Forum
Beginners
Using a stack to compare letters in a st
Using a stack to compare letters in a string
Mar 26, 2015 at 4:44pm UTC
HG319
(98)
So I have to write a code and must you a stack, to determine if the sequence is is in the form of X^nY^n.
Last edited on
Mar 26, 2015 at 7:00pm UTC
Mar 26, 2015 at 5:39pm UTC
fg109
(709)
I am not sure what is wrong with your code, it seems unnecessarily complicated to me. The only problem I can find is
seq[i+1]!=
'A'
. You would be trying to access memory outside the array when
i == seq.length() - 1
.
Topic archived. No new replies allowed.