当前位置:网站首页>The 21st - -- the 30th time
The 21st - -- the 30th time
2022-07-27 16:31:00 【andrewhxc】
The first 21 return


Lowercase letters are larger than uppercase letters , The letters after the alphabet are larger than the letters before
The first 22 return

map Is to save key value pairs ,map Duplicate keys are not allowed for , and multimap Allow key repetition


The first 23 return

set The data in will be sorted automatically
set Data duplication is not allowed ,multiset There can be duplicate data
The first 24 return

A function object is an object , But it works like a function


Function adapters can combine different function objects , Then pass it to the algorithm

The first 25 return

In the red box of the following figure is the function object , Express set The data in is sorted from small to large

Use functions for algorithms ( The figure below 1 Sum graph 2)

![]()
Use function objects for algorithms , Note that the member function in the function object must be called “operator”


Advantages of function objects over functions : Function object is an intelligent function , And it has its own type , Function objects are generally faster than ordinary functions , And function objects can have their own state
The first 26 return

count_if and count Function the same , It's just count_if You can pass in functions or function pairs as predicates , If this function has only 1 Parameters , We call this predicate “ Unary predicate ”
The return value is bool Functions or function objects of type data are called “ The predicate ”


The first 27 return

The four algorithms in the above figure are applicable to all sequential containers and associated containers
The first 28 return


find() and find_if() These two algorithms are used for all containers , Be careful ,string It's a special container , And you can only use member functions find() Function to find , And string Of find() The function returns not an iterator but a subscript

find() and find_if() Both algorithms are linear search , Slower
The first 29 return


The first 30 return

边栏推荐
猜你喜欢

2.2 JMeter基本元件

CCF-201312-1

Simulation生成报表

CCF-201312-1

Product axure9 English version, using repeater repeater to realize drop-down multi selection box

JMeter5.3 及以后的版本jmeter函数助手生成的字符在置灰无法复制

MySQL index

HowNet and Wanfang database download papers for free ----- several times faster than connecting to the school intranet (some schools Wanfang database does not support downloading)

: 0xc0000005: an access conflict occurs when writing position 0x01458000 - to be solved

JSP Foundation
随机推荐
Flume incrementally collects MySQL data to Kafka
Mazak handwheel maintenance Mazak little giant CNC machine tool handle operator maintenance av-eahs-382-1
OpenCV(四)——图像特征与目标检测
Chapter I Marxist philosophy is a scientific world outlook and methodology
SolidWorks simulation curve attribute setting
Excel extract duplicates
2021-06-02
Four solutions of maximum sub segment and go
Install MySQL using CentOS yum
JSP基础
4-digit random data
DRF learning notes (I): Data Serialization
training on multiple GPUs pytorch
新版jmeter函数助手不在选项菜单下-在工具栏中
Cron expression use
IO stream introduction
Use of arrow function
Yys mouse connector
2021-03-09
Product axure9 English version, using repeater repeater to realize drop-down multi selection box