From c to C + +

Source: Internet
Author: User

1,stack template Class (header file for <stack>) requires two parameters defined: element type (required), container type (default = Deque),

Define stack object stack <string> s

Basic operation:

S.push (x): Into the stack

S.pop (): Removes the top element of the stack but does not return the element

S.top (): Access the top of the stack

S.empty (): Determines that the stack is empty and null returns True

S.size (): Number of stack elements

2.queue

Q.push (x): queue

Q.pop (): POPs the first element of the queue but does not return a value

Q.front (): Access to the first element of the queue, that is, the first element to enter

Q.back (): Visit the end of the team

Q.empty (): Team empty

Q.size (): Number of queue elements

Reference: http://www.cnblogs.com/mfryf/archive/2012/08/09/2629992.html

From c to C + +

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.