For some reason, I have to use a stack to achieve some function, but I need to reverse the output stack’s elements. So I want to use stack<char,vector<char> to achieve direct access, but there may be some error in my suggestion. Can anyone tell me how to efficiently reverse the output stack’s elements in C++ using STL stack?
For some reason, I have to use a stack to achieve some function, but
Share
Use a temporary stack.