C++高性能并行编程与优化 - 课件 - 14 C++ 标准库系列课 - 你所不知道的 set 容器你所不知道的 set 容 器 by 小彭老师( @archibate ) 课件 & 代码: https://github.com/parallel101/course 上期回顾: https://www.bilibili.com/video/BV1qF411T7sd 课程安排 1. vector 容器初体验 & 迭代器入门 (BV1qF411T7sd) 2. 你所不知道的 set 容器 & ,内存管理与对象生命周期 set 和 vector 的区别 • 都是能存储一连串数据的容器 。 • 区别 1 : set 会自动给其中的 元素从小到大排序,而 vector 会保持插入时的顺序。 • 区别 2 : set 会把重复的元素 去除,只保留一个,即去重。 • 区别 3 : vector 中的元素在内 存中是连续的,可以高效地按 索引随机访问, set 则不行。 • 区别 4 4 : set 中的元素可以高 效地按值查找,而 vector 则 低效。 set 的排序: string 会按“字典序”来排 • set 会从小到大排序,对 int 来 说就是数值的大小比较。那么对 字符串类型 string 要怎么排序 呢? • 其实 string 类定义了运算符重 载 < ,他会按字典序比较两个 字符串。所谓字典序就是优先比 较两者第一个字符(按 ASCII 码比较),如果相等则继续比较0 码力 | 83 页 | 10.23 MB | 1 年前3
JAVA 应用与开发 - 集合与映射JAVA 应用与开发 集合与映射 让我们愉快的 Coding 起来吧... ��� �������������� November 4, 2019 ���� �����List����Set�����Map�的������� ���������� ������iterator��Enumeration ��������� API ������的������������ 1 28 �������������������������� ������用� Java �集合�� 3 28 集合�� 集合�����用���������������合����� �� O 集合类型分类 � Set ��������的������������� ������������的��� �� List ������的��������������� ������的���������������� �������� 而非对象本身。Java API 中的集合类型均定义在 java.util 包中。 4 28 集合�� 集合�����用���������������合����� �� O 集合类型分类 � Set ��������的������������� ������������的��� �� List ������的��������������� ������的���������������� ��������0 码力 | 66 页 | 713.79 KB | 1 年前3
The Swift Programming Language (Swift 5.7) - Apps Dissectedmodern, lightweight syntax, allowing complex ideas to be expressed in a clear and concise manner. As a result, code is not just easier to write, but easier to read and maintain as well. Swift has been years the Swift standard library that provides the corresponding concurrency types. On Apple platforms, set a deployment target of at least iOS 15, macOS 12, tvOS 15, or watchOS 8.0. A target written in Swift can open this chapter as a playground. Playgrounds allow you to edit the code listings and see the result immediately. Download Playground Simple Values PDF conversion courtesy of www.appsdissected.com0 码力 | 1040 页 | 10.90 MB | 1 年前3
The Swift Programming Languagethis chapter as a playground in Xcode. Playgrounds allow you to edit the code listings and see the result immediately. Simple Values Use let to make a constant and var to make a variable. The value inferred, you can write an empty array as [] and an empty dictionary as [:]—for example, when you set a new value for a variable or pass an argument to a function. 1 shoppingList = [] // Went shopping return type from the body. 1 numbers.map({ 2 (number: Int) -> Int in 3 let result = 3 * number 4 return result 5 }) E X P E R I M E N T Rewrite the closure to return zero for all odd numbers0 码力 | 525 页 | 4.68 MB | 1 年前3
Mypy 1.8.0 Documentationat runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 1.9 Protocols and structural subtyping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . function must accept specifically a list – it would run just fine if you were to pass in a tuple, a set, or any other custom iterable. You can express this idea using collections.abc.Iterable: from collections For collections on Python 3.9+, the type of the collection item is in brackets x: list[int] = [1] x: set[int] = {6, 7} # For mappings, we need the types of both keys and values x: dict[str, float] = {"field":0 码力 | 234 页 | 902.89 KB | 1 年前3
Mypy 1.10.0+dev Documentationmodule Protocols and structural subtyping Predefined protocols Simple user-defined protocols Defining subprotocols and subclassing protocols Invariance of protocol attributes Recursive protocols Using Using isinstance() with protocols Callback protocols Predefined protocol reference Dynamically typed code Operations on Any values Any vs. object Type narrowing Type narrowing expressions Casts User-Defined variables with upper bounds Type variables with value restriction Declaring decorators Generic protocols Generic type aliases Generic class internals More types The NoReturn type NewTypes Function overloading0 码力 | 318 页 | 270.84 KB | 1 年前3
Mypy 1.8.0 Documentationmodule Protocols and structural subtyping Predefined protocols Simple user-defined protocols Defining subprotocols and subclassing protocols Invariance of protocol attributes Recursive protocols Using Using isinstance() with protocols Callback protocols Predefined protocol reference Dynamically typed code Operations on Any values Any vs. object Type narrowing Type narrowing expressions Casts User-Defined variables with upper bounds Type variables with value restriction Declaring decorators Generic protocols Generic type aliases Generic class internals More types The NoReturn type NewTypes Function overloading0 码力 | 318 页 | 271.55 KB | 1 年前3
Mypy 1.10.0+dev Documentationat runtime . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 1.9 Protocols and structural subtyping . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . function must accept specifically a list – it would run just fine if you were to pass in a tuple, a set, or any other custom iterable. You can express this idea using collections.abc.Iterable: from collections For collections on Python 3.9+, the type of the collection item is in brackets x: list[int] = [1] x: set[int] = {6, 7} # For mappings, we need the types of both keys and values x: dict[str, float] = {"field":0 码力 | 234 页 | 913.89 KB | 1 年前3
Apache ActiveMQ Artemis 2.6.0 User Manual68 Apache Karaf Apache Tomcat Spring Integration CDI Integration Intercepting Operations Protocols and Interoperability Tools Maven Plugin Unit Testing Troubleshooting and Performance Tuning non-persistent messaging, our non-persistent messaging performance rocks the boat too. Full feature set. All the features you'd expect in any serious messaging system, and others you won't find anywhere naming conventions (i.e. "jms.queue." & "jms.topic." prefixes). Pure encoding of messages so protocols like AMQP don't need to convert messages to "core" format unless absolutely necessary. "MAPPED"0 码力 | 445 页 | 3.14 MB | 1 年前3
Apache ActiveMQ Artemis 2.3.0 User ManualIntegration CDI Integration 2 1.58 1.59 1.60 1.61 1.62 1.63 1.64 1.65 Intercepting Operations Protocols and Interoperability Tools Maven Plugin Unit Testing Troubleshooting and Performance Tuning non-persistent messaging, our non-persistent messaging performance rocks the boat too. Full feature set. All the features you'd expect in any serious messaging system, and others you won't find anywhere stock price update which is transitory and doesn't need to survive a restart. Messaging APIs and protocols How do client applications interact with messaging systems in order to send and consume messages0 码力 | 420 页 | 3.03 MB | 1 年前3
共 1000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 100













