"STL" Each container member comparison table

Source: Internet
Author: User
Tags bitset comparison table

Http://www.cnblogs.com/fangyukuan/archive/2010/09/21/1832675.html

Sequence containers

Associative containers

Headers

<vector>

<deque>

<list>

<set>

<bitset>

Members

Complex

Vector

Deque

List

Set

Multiset

Map

Multimap

Bitset

Constructor

*

Constructor

Constructor

Constructor

Constructor

Constructor

Constructor

Constructor

Constructor

destructor

O (N)

destructor

destructor

destructor

destructor

destructor

destructor

destructor

Operator=

O (N)

Operator=

Operator=

Operator=

Operator=

Operator=

Operator=

Operator=

Operators

Iterators

Begin

O (1)

Begin

Begin

Begin

Begin

Begin

Begin

Begin

End

O (1)

End

End

End

End

End

End

End

Rbegin

O (1)

Rbegin

Rbegin

Rbegin

Rbegin

Rbegin

Rbegin

Rbegin

Rend

O (1)

Rend

Rend

Rend

Rend

Rend

Rend

Rend

Capacity

Size

*

Size

Size

Size

Size

Size

Size

Size

Size

Max_size

*

Max_size

Max_size

Max_size

Max_size

Max_size

Max_size

Max_size

Empty

O (1)

Empty

Empty

Empty

Empty

Empty

Empty

Empty

Resize

O (N)

Resize

Resize

Resize

Element access

Front

O (1)

Front

Front

Front

Back

O (1)

Back

Back

Back

Operator[]

*

Operator[]

Operator[]

Operator[]

Operator[]

At

O (1)

At

At

Modifiers

Assign

O (N)

Assign

Assign

Assign

Insert

*

Insert

Insert

Insert

Insert

Insert

Insert

Insert

Erase

*

Erase

Erase

Erase

Erase

Erase

Erase

Erase

Swap

O (1)

Swap

Swap

Swap

Swap

Swap

Swap

Swap

Clear

O (N)

Clear

Clear

Clear

Clear

Clear

Clear

Clear

Push_front

O (1)

Push_front

Push_front

Pop_front

O (1)

Pop_front

Pop_front

Push_back

O (1)

Push_back

Push_back

Push_back

Pop_back

O (1)

Pop_back

Pop_back

Pop_back

Observers

Key_comp

O (1)

Key_comp

Key_comp

Key_comp

Key_comp

Value_comp

O (1)

Value_comp

Value_comp

Value_comp

Value_comp

Operations

Find

O (log n)

Find

Find

Find

Find

Count

O (log n)

Count

Count

Count

Count

Count

Lower_bound

O (log n)

Lower_bound

Lower_bound

Lower_bound

Lower_bound

Upper_bound

O (log n)

Upper_bound

Upper_bound

Upper_bound

Upper_bound

Equal_range

O (log n)

Equal_range

Equal_range

Equal_range

Equal_range

Unique Members

Capacity
Reserve

Splice
Remove
Remove_if
Unique
Merge
Sort
Reverse

Set
Reset
Flip
To_ulong
To_string
Test
Anynone

Excerpt from: http://www.cplusplus.com

"STL" Each container member comparison table

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.