Wednesday 25 July 2012

stack Library

<stack>


Items are popped from the top of a stack in the reverse order in which they were pushed. It does not provide any new functionality beyond a vector, deque, or list, and does not support iterators or indexing. stack<T> s; // Stack with elements of type T
s.size(), s.empty() // As with queue
s.push(x); // Put x on top
x=s.top(); // Last item pushed, may be assigned to
s.pop(); // Remove the top item

No comments:

Post a Comment