Standard Template Library (STL)

Source: Internet
Author: User

1. Standard Template Library (STL): is to provide a common template, this part of the code is high-quality code, improve the programmer's development efficiency

2.vector vectors: Essentially, the encapsulation of an array, characterized by the completion of reading in constant time, more complex inserts, and traversal through iterators

Several ways to initialize vector vectors:

  • Vector<t> V1:vector Save the object of type T. Default Construction V1 is empty
  • Vector<t> v2 (v1): V2 is a copy of V1
  • Vector<t> v3 (n,i): contains an element with n values of I
  • Vector<t> v4 (N): V4 contains n replicas with value initialization elements

Several ways to rub vector vectors:

  • Push_back (): End insert
  • Pop_back (): End Delete
  • at (int i): Take the value on position I
  • Begin ()
  • End ()
  • Front (): The value of the header
  • Back (): The value to take the tail

3.list Linked list: The feature is that the insertion is relatively simple;

4.map mapping: Stored entries are key-value pairs, and values are found by key

Standard Template Library (STL)

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.