1. ## algorithm for stack

write an algorithm using stack to determine if an input of string is in the form xCy where y is the reverse of x.x and y are strings of A and B.
eg AABACABAA 2. What are you having a problem with? You should post any code you're having trouble with (in code tags) and ask specific questions about where you're stuck. 3. I want the algorithm.I have no idea how to go about!!I have to submit this assignment by monday .If you or anyone can give me the the algorithm i would be saved . 4. write an algorithm using stack to determine if an input of string is in the form xCy where y is the reverse of x.x and y are strings of A and B.
If you or anyone can give me the the algorithm i would be saved .
Not likely going to happen - we have a homework policy here.

Since this is an assignment, it stands to reasons that you've learned something about this problem (or something that can be used for solving it) during class. For instance, have you worked with stacks yet?

Think about it, come up with some ideas, and ask questions about those ideas if you're uncertain.

But don't expect a hand-out. 5. No I have not worked with stack ever before.Its ok.whatever. 6. Since that's required for the assignment, it seems like a good place to start: Stack (abstract data type) - Wikipedia, the free encyclopedia 7. There is virtually nothing more to the algorithms for stack operations than their description.
Simply read what the stack operations do and implement that.
Do not expect anyone here to write code for you. 8. Since a stack only has two operations - push and pop, there isn't really much to figure out.

> eg AABACABAA
Or
A - push or pop - you decide. Well since you haven't done anything yet, the only real choice is push
A - push or pop - try both (on paper)
B - and so on....
A
C
A
B
A
A 9. Stack can be represented as an infinite array and the index of the empty element. In order to push the letter we put it into an array and increment the index. For popping just decrease index and get element by it. Popular pages Recent additions 