Speaking of STL (Standard Template Library), I believe that the understanding of C + + is not unfamiliar bar ^_^. LZ is from the junior start to learn C + + (PS: not trained), and slowly contact with the use of STL, in the school using STL more cases is to write data structure code, using STL implementation of data str
Introduction of STL
STL (Standard Template Library, Standard template base) is the general designation of a series of software developed by HP Labs. It was developed by Alexander Stepanov, Meng Lee and David R Musser at HP Labs. Now, although it is mainly in C + +, the technology has existed for a long time before it was introduced into C + +.
STL code is broad
"Effective STL Chinese Version" PrefaceThe first time I wrote about STL (standard templatelibrary, Standards Template Library) was introduced in 1995, when I made a cursory introduction to STL in the last article in more effective C + +. Shortly thereafter, I received some emails asking when I was going to start writing effective
use of C + + STL basic containersCategory: C/c++/vc2014-04-09 21:01 583 People read comments (0) favorite reports StllistmapdequesetThere are two types of containers in C + +: Sequential containers and associative containers. The sequential containers are mainly vector, list, deque and so on. Where vectors represent a contiguous memory, based on an array implementation, List represents noncontiguous memory, is based on a linked list, deque is simi
A doubly linked list is a common data structure. It's not complicated, and it's not too difficult if we're going to make it ourselves. But since the STL has provided us with one, it may be used directly. To do so, not only saves time and effort, but also the reusability of code. Header files and template classes To use a doubly linked list provided by STL, you need to include a header file #include This a
Algorithms that use the C + + standard library include header files The STL algorithm is used to process one or more iterator intervals, and the first interval is usually expressed as a starting point and an end point, while the other intervals simply provide a starting point, and the end point can be deduced based on the number of elements in the first interval. The caller is required to guarantee the validity of the interval. When the
Topic linksIdea: STL Dafa Good to remove the end of the character 0, and then compare the size of the string, while using the automatic map of the name in accordance with the dictionary output, >>>stl Dafa good#include #include#include#include#include#includeSet>#includeusing namespacestd;Const intn=2e5+Ten; Mapstring,int>A;mapstring,string>b;structnode{stringb;} C[i]; voidSolvestringS1) { intlen1=s1.siz
occurrence of a sub-rangeFind_end search for the last occurrence of a sub-rangeFind_first_of search for the first element equal to one of the valuesAdjacent_find search for two consecutive equal elementsEqual determine if two intervals are equalMismatch judge whether two intervals are equalLexicographical_compare is less than another sequenceComparison of string search function and STL search algorithmSearching for a string function
function objects and predicates in STL algorithmsfunction objects and predicates define function objects:classes that overload function invocation operators, whose objects are often called function objects, are objects that behave like functions. A class object that shows the characteristics of a function that is through the object name + (Parameter list) "uses a class object in a way that can be treated as a function if there is no context.This is do
Even if you understand the data structure, efficient to write a tree structure, it is not easy to estimate, but since the use of STL, this is as simple as building blocks, and has a high stability.
I use the vector container as a base to form a tree.
For example, we want to generate the following structure of the tree.
3
2 2 2 2
1111 1111 1111 1111
This is a class quadtree and the lower level is 1 smaller than the upper level.
See Code://Use
STL Knowledge Point. Outline.
------"The Standard Template Library self-study tutorial and Reference manual STL for C + + programming"------ STLOf6Large components:Container、Generic algorithm、iterators、Function Object、Adapters、Distributor。 ---------------------------------------------------------------------------------------------iterators: Iterators are objects that resemble poi
list object X's linked list into the current list link list. and empty the list of the x when merging, according to the current element one by one comparison and copied to the current listlist Element ProcessingL.sort () Merges the list L to sort, for example: C1.sort (); Default from small to large c1.sort (greatThe list L is excluded from continuous elements, for example: L Before: 6 8 6 6 6 9 13 6 call Unique () after: 6 8 6 9 for 6 l.unique (bool Function (t item1, t item2)) Write your own
Use of the vector of the STL
Getting started with the first part
Vectors can be used instead of arrays in C, or CArray in MFC, from many explanatory documents or online comments, and generally agree that vectors should be used more efficiently and with exceptional security. And vectors are the default containers recommended by STL, unless you know you have special needs, using vectors that do not meet your
Tags: STL stl array Arrayhere is a summary of the array method, the specific can be seen in the following links:Public member function std::array::operator[] Reference operator[] (size_type n); Const_reference operator[] (size_type n) const;returns a reference to an element of position n in the array container. Parameters
N
The position of the element in the array.
Detailed explanation of STL sorting (sort)Http://www.cppblog.com/mzty/archive/2005/12/15/1770.htmlDetailed explanation of STL sorting (sort) Author winter
Detailed explanation of STL sorting (sort)
0 Preface: STL, why do you have to master
1 the sort algorithm provided by the
Article 50: familiarize yourself with STL-related websites
The Internet is full of STL information. Search for "STL" using your favorite search engine. It will certainly return several hundred links, some of which may actually be related. However, for most STL programmers, there is no need to search. The following webs
Document directory
Left and right
C ++ left value and right value Extension
Use of function objects
Custom function object
Index
Data Structure weapon-private data center STL (on)
Data Structure weapon-private data center STL (medium)
Data Structure tool-private data center STL (lower)
This article http://www.cnblogs.com/daoluanxiaozi/archive/2012/
Experience STL. NET[Translation] zengyi820 2004-10-07
To better adapt STL.. NET development, Visual C ++ product group, re-designed STL in Visual C ++ 2005 and named it STL. NET, which is provided from Beta1 products.In STL. NET Design,
C + + STL Collection Set Introduction C + + STL collection (set) is an associative container that contains sorted objects. Set/multiset automatically sorts the elements according to the sort criteria that are pending. The difference is that the former does not allow elements to be duplicated, while the latter allows. 1) can not directly change the value of the element, because that will upset the original .
Http://www.cppblog.com/mzty/archive/2005/12/15/1770.html
Detailed explanation of STL sorting (sort)
0 Preface: STL, why do you have to master
1 the sort algorithm provided by the STL
1.1 Introduction to all sort algorithms
The comparison function in 1.2 sort
Stability of the 1.3 sort
1.4 Full Order
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.