Stack (STATCK)
This kind of data structure is quite famous in the computer. The data in the stack is advanced (first in the last out, FILO). The stack has only one exit, allowing new elements (which can only be added on top of the stack), moving out of the element (only the top of the stack), and getting the top element of the stack.
In STL, the stack is the other container as the bottom structure, then the interface changes, so that it conforms to the characteristics of the stack. So the implementation is very convenient. The following is a list of the functions of the stack and the source code of the stack in the VS2008, in the STL stack of 5 commonly used operation functions (top (), push (), pop (), size (), empty () , very good to remember.
to empty the stack, only use the while () loop.
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
150727 Training Experience (Stack)