C + + deque dual-ended queue

Source: Internet
Author: User

Dual-ended queues:
Function Describe
C.assign (Beg,end)
C.assign (N,elem)
Assigns the data in the [beg; end] Interval to C.
Assigns a copy of n elem to C.
c.at (IDX) Returns the index IDX refers to the data, if the IDX is out of bounds, throws Out_of_range.
C.back () Returns the last data without checking to see if the data exists.
C.begin () Returns a data that is valued by the iterator.
C.clear () Removes all data from the container.
Deque<elem> C
Deque<elem> C1 (C2)
Deque<elem> C (N)
Deque<elem> c (n, Elem)
Deque<elem> C (beg,end)
C.~deque<elem> ()
Create an empty deque.
Copy a deque.
Creates a deque that contains n data, and the data is constructed by default.
Create a deque that contains n elem copies.
Create a deque with an interval of [beg;end].
Destroys all data and frees up memory.
C.empty () Determines whether the container is empty.
C.end () Points to the last data address in the iterator.
C.erase (POS)
C.erase (Beg,end)
Deletes data from the POS location and returns the location of the next data.
Delete the data from the [Beg,end] interval and return to the location of the next data.
C.front () Returns a data back to the ground.
Get_allocator Use the constructor to return a copy.
C.insert (Pos,elem)
C.insert (Pos,n,elem)
C.insert (Pos,beg,end)
Inserts a elem copy at the POS location and returns the new data location.
Inserts >n elem data at the POS location. no return value.
Inserts the data in the [Beg,end] interval at the POS location. no return value.
C.max_size () Returns the maximum number of data in a container.
C.pop_back () Delete the last data.
C.pop_front () Delete header data.
C.push_back (Elem) Add a data to the trailer.
C.push_front (Elem) Inserts a data into the head.
C.rbegin () Returns the first data for a reverse queue.
C.rend () Returns the next position of the last data in a reverse queue.
C.resize (num) Re-specify the length of the queue.
C.size () Returns the number of actual data in the container.
C1.swap (C2)
Swap (C1,C2)
Swaps the C1 and C2 elements.
Above operation.

C + + deque dual-ended queue

Related Article

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.