mirror of
https://github.com/changkun/modern-cpp-tutorial.git
synced 2025-12-16 20:27:08 +03:00
book: re-compose words to avoid out of pdf's margin (#229)
This commit is contained in:
@@ -118,7 +118,7 @@ And select the appropriate location to insert into the container. When traversin
|
||||
The elements in the unordered container are not sorted, and the internals is implemented by the Hash table. The average complexity of inserting and searching for elements is `O(constant)`,
|
||||
Significant performance gains can be achieved without concern for the order of the elements inside the container.
|
||||
|
||||
C++11 introduces two sets of unordered containers: `std::unordered_map`/`std::unordered_multimap` and
|
||||
C++11 introduces two unordered containers: `std::unordered_map`/`std::unordered_multimap` and
|
||||
`std::unordered_set`/`std::unordered_multiset`.
|
||||
|
||||
Their usage is basically similar to the original `std::map`/`std::multimap`/`std::set`/`set::multiset`
|
||||
|
||||
@@ -115,7 +115,7 @@ std::sort(arr.begin(), arr.end());
|
||||
而无序容器中的元素是不进行排序的,内部通过 Hash 表实现,插入和搜索元素的平均复杂度为 `O(constant)`,
|
||||
在不关心容器内部元素顺序时,能够获得显著的性能提升。
|
||||
|
||||
C++11 引入了两组无序容器:`std::unordered_map`/`std::unordered_multimap` 和
|
||||
C++11 引入了的两组无序容器分别是:`std::unordered_map`/`std::unordered_multimap` 和
|
||||
`std::unordered_set`/`std::unordered_multiset`。
|
||||
|
||||
它们的用法和原有的 `std::map`/`std::multimap`/`std::set`/`set::multiset` 基本类似,
|
||||
|
||||
Reference in New Issue
Block a user