[STL Study Notes] deques

Source: Internet
Author: User

The deque bidirectional queue is a bidirectional open continuous linear space that can efficiently insert and delete elements at both ends of the head and tail. The deque interface is very similar to the vector. The deque implementation is complicated and a map is maintained internally (note! It is not a map container in STL, that is, a small contiguous space. Each element in the space is a pointer pointing to another (larger) area, which is called a buffer zone, the buffer is used to save data in deque. Therefore, deque is slower than vector in random access and data traversal.

The operations of deque are only different from those of vector in the following two ways:

1. deques does not provide capacity operations (capacity () and reserve ())

2. deque directly provides functions for inserting and deleting header elements (push_front () and pop_back ())

 

[STL Study Notes] deques

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.