Reading Notes: C ++ STL Development Technology Guide-3

Source: Internet
Author: User

Chapter 2 string Basic Character Sequence container


Common string functions

Http://www.cplusplus.com/reference/string/string/


 

Chapter 2 stack container

A stack is an adapter.


Stack implementation


The stack size in C ++ STL is not preset. Therefore, when the stack is imported, whether the stack space is full or not is not considered. All elements are pushed to the stack, therefore, the function does not indicate whether the stack is successful or not.

Stack container Functions

Http://www.cplusplus.com/reference/stl/stack/


Chapter 2 Queue queue container


QueueSource code


Queue container Functions

Http://www.cplusplus.com/reference/stl/queue/


 

Chapter 2 priority_queue priority queue container


 

Priority_queue container Function

Http://www.cplusplus.com/reference/stl/priority_queue/

In the implementation of priority_queue, three functions are mainly used: make_heap, push_heap, and pop_heap.

The make_heap function sorts the elements of the array to create a heap. Push_heap inserts new elements into the heap. The pop_heap function moves the maximum element to the last position. Elements are not actually deleted.

Below isCode:

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.