Double Stack implementation

So I'm working on a project that utilizes a double stack. The program will take a line of text from a file and read it in, separating upper and lower case letters into two different stacks. One stack for lowercase and one stack for uppercase. My question is: when I implement this double stack class, will I need to write a member function for each corresponding stack? I.E.
1
2
3
4
bool emptyStackOne();
bool emptyStackTwo();
void pushStackOne();
void pushStackTwo();


or...
could I simply write the class as usual, and implement the two stacks within the same member function and use the driver to manipulate the data to my liking?

Any assistance or pointers (no pun intended) would be much appreciated, please and thank you
Last edited on
closed account (Lv0f92yv)
Personally, I don't see why you don't just use two separate instances of the same stack class (which would be a normal stack class), and managed each separate stack separately depending on if you get/have a lower or upper case char.

If you really want to write a special stack class and keep the data separate, then I would think you would need to do what you had originally suggested, and internally manage the two separate stacks.
Topic archived. No new replies allowed.