STL source code-sequence container (1)

Source: Internet
Author: User

1. vector, list, And deque

Iterator

Original vector pointer

List random iterator

Deque custom iterator, which can be operated by + n

Iterator failed

The insertion and deletion of a vector after the insertion and deletion points will become invalid (excluding the end; insertion will become invalid if it is re-allocated; it is clear that all values will also become invalid.

The list will not expire except the deleted vertex.

Deque will expire except the end and end

Underlying Storage

Vector is similar to continuous storage of arrays.

Random list Storage

Deque pseudo-continuous storage, with a map controlling each buffer zone

 

Ii. adapters such as stack and queue

No iterator; you can specify the containers implemented at the underlying layer. The default value is deque.

STL source code-sequence container (1)

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.