I need the steps to proceed for finding common elements in 2 stacks and creating a 3rd stack called common stack with common values from both. Assume that duplicate values are allowed
Look at first value in first stack. Compare it to all values in second stack. If you find a match, copy to third stack and stop comparing.
Repeat for all values in first stack.
Hi, I didn't understand it on implementation part of it, should I use 2 for loops and an if condition.
I'm confused, I'm new to c++ so can you send me the code of match the values in 2 stacks in copying in 3 stack.