diff --git a/.idea/doc.iml b/.idea/doc.iml
index 7584dbd9..6407684b 100644
--- a/.idea/doc.iml
+++ b/.idea/doc.iml
@@ -4,7 +4,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
index 37d04b23..20664375 100644
--- a/.idea/misc.xml
+++ b/.idea/misc.xml
@@ -3,5 +3,5 @@
-
+
\ No newline at end of file
diff --git a/README.md b/README.md
index 2544a003..8db06047 100644
--- a/README.md
+++ b/README.md
@@ -9,7 +9,7 @@
- 环境安装
``` python
pip install -r requirements.txt
- ```
+ ```
- 运行start.py
@@ -29,4 +29,4 @@ $ mkdocs serve # 在本地启动服务器预览
- 在工单中提交需求
- 联系我:sairate@sina.cn
-
+
diff --git a/notebook/.idea/workspace.xml b/notebook/.idea/workspace.xml
index 07d9059e..2b906ba7 100644
--- a/notebook/.idea/workspace.xml
+++ b/notebook/.idea/workspace.xml
@@ -1,3 +1,4 @@
+
@@ -1,29 +1,73 @@
@@ -93,3 +94,93 @@
+
\ No newline at end of file
+=======
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {
+ "associatedIndex": 3
+}
+
+
+
+
+
+ {
+ "keyToString": {
+ "RunOnceActivity.OpenProjectViewOnStart": "true",
+ "RunOnceActivity.ShowReadmeOnStart": "true",
+ "git-widget-placeholder": "master",
+ "nodejs_package_manager_path": "npm",
+ "vue.rearranger.settings.migration": "true"
+ }
+}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1725513042181
+
+
+ 1725513042181
+
+
+
+
+
+
+
+
+
+
diff --git a/notebook/docs/C++/1.iostream.md b/notebook/docs/C++/1.iostream.md
new file mode 100644
index 00000000..8b6e613a
--- /dev/null
+++ b/notebook/docs/C++/1.iostream.md
@@ -0,0 +1,28 @@
+1. `cout`: 用于标准输出,可以使用`<<`操作符将数据输出到屏幕上。
+
+ ```cpp
+ std::cout << "Hello, world!" << std::endl;
+ ```
+
+2. `cin`: 用于标准输入,可以使用`>>`操作符从用户输入中读取数据。
+ ```cpp
+ int num;
+ std::cin >> num;
+ ```
+
+3. `endl`: 输出换行符并刷新输出缓冲区。
+ ```cpp
+ std::cout << "Hello" << std::endl;
+ ```
+
+4. `cerr`: 用于输出错误信息,通常用于标准错误流。
+
+ ```cpp
+ std::cerr << "Error: something went wrong!" << std::endl;
+ ```
+
+5. `fixed`和`setprecision`: 用于控制浮点数的输出精度。
+ ```cpp
+ double num = 3.14159;
+ std::cout << std::fixed << std::setprecision(2) << num << std::endl;
+ ```
diff --git a/notebook/docs/C++/10.algorithm.md b/notebook/docs/C++/10.algorithm.md
new file mode 100644
index 00000000..ae4a237e
--- /dev/null
+++ b/notebook/docs/C++/10.algorithm.md
@@ -0,0 +1,89 @@
+1. **查找和比较**:
+ - `find`:在范围内查找元素。
+ - `find_if`:在范围内查找满足指定条件的元素。
+ - `count`:统计范围内满足条件的元素个数。
+ - `count_if`:统计范围内满足指定条件的元素个数。
+ - `equal`:比较两个范围是否相等。
+ - `lexicographical_compare`:按字典序比较两个范围。
+
+```cpp
+#include
+#include
+#include
+using namespace std;
+
+int main() {
+ vector vec = {1, 2, 3, 4, 5};
+
+ // 查找元素
+ auto it = find(vec.begin(), vec.end(), 3);
+ if (it != vec.end()) {
+ cout << "Element found: " << *it << endl;
+ }
+
+ // 查找满足条件的元素
+ auto it2 = find_if(vec.begin(), vec.end(), [](int x) { return x > 3; });
+ if (it2 != vec.end()) {
+ cout << "Element > 3 found: " << *it2 << endl;
+ }
+
+ // 统计元素个数
+ int num = count(vec.begin(), vec.end(), 2);
+ cout << "Number of 2s: " << num << endl;
+
+ // 比较两个范围
+ vector vec2 = {1, 2, 3};
+ bool result = equal(vec.begin(), vec.end(), vec2.begin(), vec2.end());
+ if (result) {
+ cout << "Vectors are equal" << endl;
+ } else {
+ cout << "Vectors are not equal" << endl;
+ }
+
+ return 0;
+}
+```
+
+2. **排序和操作**:
+ - `sort`:对范围内的元素进行排序。
+ - `reverse`:反转范围内的元素顺序。
+ - `copy`:将范围内的元素复制到另一个位置。
+ - `remove`:移除范围内满足条件的元素(不会改变容器大小)。
+ - `remove_if`:移除范围内满足指定条件的元素(不会改变容器大小)。
+ - `transform`:对范围内的元素执行指定操作。
+
+```cpp
+#include
+#include
+#include
+using namespace std;
+
+int main() {
+ vector vec = {5, 3, 1, 4, 2};
+
+ // 排序
+ sort(vec.begin(), vec.end());
+
+ // 反转元素顺序
+ reverse(vec.begin(), vec.end());
+
+ // 复制元素到另一个位置
+ vector vec2(5);
+ copy(vec.begin(), vec.end(), vec2.begin());
+
+ // 移除元素
+ vec.erase(remove(vec.begin(), vec.end(), 3), vec.end());
+
+ // 对元素执行操作
+ transform(vec.begin(), vec.end(), vec.begin(), [](int x) { return x * 2; });
+
+ // 输出元素
+ for (auto& num : vec) {
+ cout << num << " ";
+ }
+ cout << endl;
+
+ return 0;
+}
+```
+
diff --git a/notebook/docs/C++/2.fstream.md b/notebook/docs/C++/2.fstream.md
new file mode 100644
index 00000000..4592f507
--- /dev/null
+++ b/notebook/docs/C++/2.fstream.md
@@ -0,0 +1,87 @@
+1. `std::ifstream`: 用于从文件中读取数据的输入流对象。常用的成员函数包括:
+
+ - `open(const char* filename)`: 打开指定文件名的文件。
+ - `close()`: 关闭文件。
+ - `is_open()`: 判断文件是否已经打开。
+ - `good()`: 判断文件流状态是否良好。
+
+ ```cpp
+ #include
+ #include
+
+ int main() {
+ std::ifstream inputFile;
+ inputFile.open("input.txt");
+
+ if (inputFile.is_open()) {
+ std::cout << "File opened successfully." << std::endl;
+ // 读取文件内容
+ std::string line;
+ while (std::getline(inputFile, line)) {
+ std::cout << line << std::endl;
+ }
+ inputFile.close();
+ } else {
+ std::cerr << "Unable to open file." << std::endl;
+ }
+
+ return 0;
+ }
+ ```
+
+2. `std::ofstream`: 用于向文件中写入数据的输出流对象。常用的成员函数包括:
+ - `open(const char* filename)`: 创建或打开指定文件名的文件。
+ - `close()`: 关闭文件。
+ - `is_open()`: 判断文件是否已经打开。
+ - `good()`: 判断文件流状态是否良好。
+
+ ```cpp
+ #include
+ #include
+
+ int main() {
+ std::ofstream outputFile;
+ outputFile.open("output.txt");
+
+ if (outputFile.is_open()) {
+ std::cout << "File opened successfully." << std::endl;
+ // 写入数据到文件
+ outputFile << "Hello, world!" << std::endl;
+ outputFile << 42 << std::endl;
+ outputFile.close();
+ } else {
+ std::cerr << "Unable to open file." << std::endl;
+ }
+
+ return 0;
+ }
+ ```
+
+3. `std::fstream`: 同时支持读写操作的文件流对象。常用的成员函数包括:
+ - `open(const char* filename, std::ios_base::openmode mode)`: 打开指定文件名的文件,并指定打开模式(例如`std::ios::in`表示读取模式,`std::ios::out`表示写入模式)。
+ - `close()`: 关闭文件。
+ - `is_open()`: 判断文件是否已经打开。
+ - `good()`: 判断文件流状态是否良好。
+
+ ```cpp
+ #include
+ #include
+
+ int main() {
+ std::fstream file;
+ file.open("data.txt", std::ios::out | std::ios::app);
+
+ if (file.is_open()) {
+ std::cout << "File opened successfully." << std::endl;
+ // 写入数据到文件
+ file << "Appended line." << std::endl;
+ file.close();
+ } else {
+ std::cerr << "Unable to open file." << std::endl;
+ }
+
+ return 0;
+ }
+ ```
+
+这些函数和对象使得在C++中进行文件输入输出操作变得简单和方便。
\ No newline at end of file
diff --git a/notebook/docs/C++/3.string.md b/notebook/docs/C++/3.string.md
new file mode 100644
index 00000000..865c4f6f
--- /dev/null
+++ b/notebook/docs/C++/3.string.md
@@ -0,0 +1,76 @@
+1. `std::string`: C++中的字符串类,提供了丰富的成员函数用于字符串操作。常用的成员函数包括:
+ - `size()`: 返回字符串的长度。
+ - `length()`: 返回字符串的长度。
+ - `empty()`: 判断字符串是否为空。
+ - `clear()`: 清空字符串内容。
+ - `substr(pos, len)`: 返回从位置`pos`开始长度为`len`的子字符串。
+ - `find(str, pos)`: 在字符串中查找子字符串`str`,并返回第一次出现的位置。
+ - `replace(pos, len, str)`: 替换字符串中从位置`pos`开始长度为`len`的子串为字符串`str`。
+ - `append(str)`: 在字符串末尾追加字符串`str`。
+ - `insert(pos, str)`: 在指定位置插入字符串`str`。
+
+ ```cpp
+ #include
+ #include
+
+ int main() {
+ std::string str = "Hello, world!";
+
+ // 使用成员函数进行字符串操作
+ std::cout << "Length: " << str.length() << std::endl;
+ std::cout << "Substring: " << str.substr(0, 5) << std::endl;
+
+ str.replace(7, 5, "C++");
+ std::cout << "Replaced: " << str << std::endl;
+
+ str.append(" Goodbye!");
+ std::cout << "Appended: " << str << std::endl;
+
+ str.insert(0, "Greetings, ");
+ std::cout << "Inserted: " << str << std::endl;
+
+ return 0;
+ }
+ ```
+
+2. `std::getline()`: 从输入流中读取一行数据并存储到字符串中。
+ ```cpp
+ #include
+ #include
+
+ int main() {
+ std::string line;
+ std::cout << "Enter a line of text: ";
+ std::getline(std::cin, line);
+ std::cout << "You entered: " << line << std::endl;
+
+ return 0;
+ }
+ ```
+
+3. 字符串查找和比较函数:
+ - `std::string::find(str, pos)`: 在字符串中查找子字符串`str`,并返回第一次出现的位置。
+ - `std::string::rfind(str, pos)`: 在字符串中从后向前查找子字符串`str`,并返回第一次出现的位置。
+ - `std::string::find_first_of(str, pos)`: 在字符串中查找任意字符集合`str`中的字符,返回第一次出现的位置。
+ - `std::string::find_last_of(str, pos)`: 在字符串中从后向前查找任意字符集合`str`中的字符,返回第一次出现的位置。
+ - `std::string::compare(str)`: 比较字符串与`str`,返回大小关系(0表示相等,负数表示小于,正数表示大于)。
+
+ ```cpp
+ #include
+ #include
+
+ int main() {
+ std::string str = "Hello, world!";
+
+ if (str.find("world") != std::string::npos) {
+ std::cout << "Substring found!" << std::endl;
+ }
+
+ if (str.compare("Hello, C++!") == 0) {
+ std::cout << "Strings are equal." << std::endl;
+ }
+
+ return 0;
+ }
+ ```
+
diff --git a/notebook/docs/C++/4.ctime.md b/notebook/docs/C++/4.ctime.md
new file mode 100644
index 00000000..0d687e30
--- /dev/null
+++ b/notebook/docs/C++/4.ctime.md
@@ -0,0 +1,43 @@
+1. `time_t time(time_t* timer)`: 返回当前的日历时间作为一个 `time_t` 对象。如果 `timer` 不是 NULL,则结果也存储在 `timer` 指向的变量中。
+2. `struct tm *localtime(const time_t* timer)`: 将日历时间 `timer` 转换为本地时间表示(`struct tm`),包括年、月、日、时、分和秒等字段。
+3. `struct tm *gmtime(const time_t* timer)`: 类似于 `localtime`,但它将日历时间 `timer` 转换为协调世界时(UTC)。
+4. `time_t mktime(struct tm* timeptr)`: 将表示日历时间的 `struct tm` 对象转换为 `time_t` 对象。
+5. `char* asctime(const struct tm* timeptr)`: 将 `struct tm` 对象转换为人类可读的字符串,表示日期和时间的格式为 "Www Mmm dd hh:mm:ss yyyy\n",其中 Www 是星期几,Mmm 是月份,dd 是日期,hh:mm:ss 是时间,yyyy 是年份。
+6. `char* ctime(const time_t* timer)`: 等同于 `asctime(localtime(timer))`。它将 `time_t` 对象转换为人类可读的字符串,表示本地时间。
+7. `clock_t clock(void)`: 返回程序自执行开始以来或上一次调用 `clock()` 以来消耗的处理器时间。返回的值以时钟滴答数表示,可以使用 `CLOCKS_PER_SEC` 将其转换为秒。
+
+```c++
+#include
+#include
+
+int main() {
+ // 获取当前时间
+ time_t now = time(0);
+ std::cout << "当前时间为:" << ctime(&now);
+
+ // 将当前时间转换为本地时间
+ struct tm *localTime = localtime(&now);
+ std::cout << "本地时间为:" << asctime(localTime);
+
+ // 将当前时间转换为UTC时间
+ struct tm *utcTime = gmtime(&now);
+ std::cout << "UTC时间为:" << asctime(utcTime);
+
+ // 将本地时间结构体转换为时间戳
+ time_t localTimestamp = mktime(localTime);
+ std::cout << "本地时间的时间戳为:" << localTimestamp << std::endl;
+
+ // 测量程序执行时间
+ clock_t start = clock();
+ for (int i = 0; i < 1000000; ++i) {
+ // 一些计算任务
+ }
+ clock_t end = clock();
+ double elapsedSeconds = double(end - start) / CLOCKS_PER_SEC;
+ std::cout << "程序执行时间为:" << elapsedSeconds << " 秒" << std::endl;
+
+ return 0;
+}
+
+```
+
diff --git a/notebook/docs/C++/5.chrono.md b/notebook/docs/C++/5.chrono.md
new file mode 100644
index 00000000..8d47ce68
--- /dev/null
+++ b/notebook/docs/C++/5.chrono.md
@@ -0,0 +1,58 @@
+1. **时长类型**:
+ - `std::chrono::duration`:表示时间段。例如,`std::chrono::duration` 表示基于整数的时间段,而 `std::chrono::duration` 表示基于浮点数的时间段。
+ - `std::chrono::hours`、`std::chrono::minutes`、`std::chrono::seconds`、`std::chrono::milliseconds`、`std::chrono::microseconds`、`std::chrono::nanoseconds`:具有不同单位的特定时长类型。
+
+2. **时间点类型**:
+ - `std::chrono::time_point`:表示时间点。它在时钟类型和时长类型上进行模板化。
+ - `std::chrono::system_clock`、`std::chrono::steady_clock`、`std::chrono::high_resolution_clock`:`` 提供的时钟类型。
+
+3. **时钟函数**:
+ - `std::chrono::duration_cast`:将一个时长转换为具有不同刻度的另一个时长。
+ - `std::chrono::time_point_cast`:将一个时间点转换为具有不同时钟的另一个时间点。
+ - `std::chrono::system_clock::now()`:根据系统时钟获取当前时间。
+ - `std::chrono::steady_clock::now()`:根据稳定时钟(单调时钟)获取当前时间。
+ - `std::chrono::high_resolution_clock::now()`:如果可用,根据高分辨率时钟获取当前时间。
+
+4. **实用函数**:
+ - `std::chrono::duration_values`:提供时长类型的最小值和最大值。
+ - `std::chrono::time_point::min()`、`std::chrono::time_point::max()`:返回时间点类型的最小值和最大值。
+
+5. **算术运算**:
+ - 时长类型支持算术运算,如加法(`operator+`)、减法(`operator-`)、乘法(`operator*`)、除法(`operator/`)以及比较运算(`operator==`、`operator!=`、`operator<` 等)。
+
+6. **时长字面值**:
+ - 可以使用字面值后缀,如 `h`、`min`、`s`、`ms`、`us`、`ns` 来创建时长字面值。例如,`5s` 表示 5 秒。
+
+这里是一个简单的示例,演示了这些功能:
+
+```cpp
+#include
+#include
+
+int main() {
+ using namespace std::chrono;
+
+ // 定义时长
+ auto 秒 = seconds(10);
+ auto 毫秒 = 5ms;
+
+ // 添加时长
+ auto 总时长 = 秒 + 毫秒;
+
+ // 获取当前时间点
+ auto 开始 = steady_clock::now();
+
+ // 等待 2 秒
+ std::this_thread::sleep_for(2s);
+
+ // 计算经过的时间
+ auto 结束 = steady_clock::now();
+ auto 经过时间 = duration_cast(结束 - 开始);
+
+ std::cout << "总时长:" << 总时长.count() << " 毫秒\n";
+ std::cout << "经过时间:" << 经过时间.count() << " 秒\n";
+
+ return 0;
+}
+```
+
diff --git a/notebook/docs/C++/6.vector.md b/notebook/docs/C++/6.vector.md
new file mode 100644
index 00000000..225bf444
--- /dev/null
+++ b/notebook/docs/C++/6.vector.md
@@ -0,0 +1,82 @@
+1. **构造函数**:
+ - `vector`:创建一个空的向量,元素类型为 `T`。
+ - `vector(size_type count)`:创建包含 `count` 个默认构造的元素的向量。
+ - `vector(size_type count, const T& value)`:创建包含 `count` 个值为 `value` 的元素的向量。
+ - `vector(InputIterator first, InputIterator last)`:使用迭代器范围 `[first, last)` 中的元素创建向量。
+
+2. **元素访问**:
+ - `vector::operator[]`:通过索引访问元素。
+ - `vector::at(size_type pos)`:通过位置访问元素,如果越界会抛出 `std::out_of_range` 异常。
+ - `vector::front()`:返回第一个元素的引用。
+ - `vector::back()`:返回最后一个元素的引用。
+ - `vector::data()`:返回指向底层数据的指针。
+
+3. **迭代器**:
+ - `vector::begin()`:返回指向第一个元素的迭代器。
+ - `vector::end()`:返回指向最后一个元素后面位置的迭代器。
+ - `vector::rbegin()`:返回指向最后一个元素的逆向迭代器。
+ - `vector::rend()`:返回指向第一个元素前面位置的逆向迭代器。
+
+4. **容量**:
+ - `vector::size()`:返回向量中元素的数量。
+ - `vector::max_size()`:返回向量能容纳的最大元素数量。
+ - `vector::empty()`:检查向量是否为空。
+ - `vector::reserve(size_type new_cap)`:为向量预留至少能容纳 `new_cap` 个元素的空间。
+ - `vector::capacity()`:返回向量当前能容纳的元素数量。
+
+5. **修改容器**:
+ - `vector::push_back(const T& value)`:在向量末尾添加一个元素。
+ - `vector::pop_back()`:移除向量末尾的元素。
+ - `vector::insert(iterator pos, const T& value)`:在指定位置插入一个元素。
+ - `vector::erase(iterator pos)`:移除指定位置的元素。
+ - `vector::clear()`:清空向量中的所有元素。
+
+6. **比较**:
+ - `vector::operator==`、`vector::operator!=`、`vector::operator<`、`vector::operator<=`、`vector::operator>`、`vector::operator>=`:用于比较两个向量的操作符。
+
+7. **其他操作**:
+ - `vector::swap(vector& other)`:交换两个向量的内容。
+ - `vector::emplace_back(Args&&... args)`:在向量末尾构造一个元素。
+ - `vector::shrink_to_fit()`:将向量的容量调整为其当前元素数量。
+
+```c++
+#include
+#include
+
+int main() {
+ // 创建一个空的整数向量
+ std::vector numbers;
+
+ // 在向量末尾添加元素
+ numbers.push_back(10);
+ numbers.push_back(20);
+ numbers.push_back(30);
+
+ // 使用迭代器遍历向量并输出元素
+ std::cout << "Vector elements:";
+ for (auto it = numbers.begin(); it != numbers.end(); ++it) {
+ std::cout << " " << *it;
+ }
+ std::cout << std::endl;
+
+ // 访问向量的第一个和最后一个元素
+ std::cout << "First element: " << numbers.front() << std::endl;
+ std::cout << "Last element: " << numbers.back() << std::endl;
+
+ // 检查向量是否为空
+ std::cout << "Is the vector empty? " << (numbers.empty() ? "Yes" : "No") << std::endl;
+
+ // 获取向量的大小和容量
+ std::cout << "Vector size: " << numbers.size() << std::endl;
+ std::cout << "Vector capacity: " << numbers.capacity() << std::endl;
+
+ // 清空向量
+ numbers.clear();
+
+ std::cout << "Vector size after clear: " << numbers.size() << std::endl;
+
+ return 0;
+}
+
+```
+
diff --git a/notebook/docs/C++/7.list.md b/notebook/docs/C++/7.list.md
new file mode 100644
index 00000000..5b824e04
--- /dev/null
+++ b/notebook/docs/C++/7.list.md
@@ -0,0 +1,150 @@
+1. **构造函数**:
+ - `list()`:创建一个空链表。
+ - `list(const list& other)`:拷贝构造函数,用另一个链表初始化当前链表。
+
+2. **赋值和交换**:
+ - `operator=`:将一个链表赋值给另一个链表。
+ - `assign`:用特定数量的元素或范围内的元素替换链表的内容。
+ - `swap`:交换两个链表的内容。
+
+3. **迭代器相关**:
+ - `begin`:返回指向第一个元素的迭代器。
+ - `end`:返回指向最后一个元素之后的位置的迭代器。
+ - `rbegin`:返回指向最后一个元素的反向迭代器。
+ - `rend`:返回指向第一个元素之前的位置的反向迭代器。
+
+4. **容量**:
+ - `empty`:判断链表是否为空。
+ - `size`:返回链表中元素的数量。
+ - `max_size`:返回链表最大可容纳的元素数量。
+
+5. **访问元素**:
+ - `front`:返回第一个元素的引用。
+ - `back`:返回最后一个元素的引用。
+
+6. **修改容器**:
+ - `push_front`:在链表的开头插入一个元素。
+ - `pop_front`:移除链表的第一个元素。
+ - `push_back`:在链表的末尾插入一个元素。
+ - `pop_back`:移除链表的最后一个元素。
+ - `insert`:在指定位置插入一个或多个元素。
+ - `erase`:移除指定位置或范围内的一个或多个元素。
+ - `clear`:移除链表的所有元素。
+
+7. **其他操作**:
+ - `splice`:将另一个链表的元素移动到当前链表的指定位置。
+ - `merge`:将两个有序链表合并为一个有序链表。
+ - `sort`:对链表进行排序。
+ - `reverse`:反转链表中的元素顺序。
+
+
+
+1. **构造函数**:
+
+ ```cpp
+ #include
+ #include
+ using namespace std;
+
+ int main() {
+ // 创建空链表
+ list mylist;
+
+ // 用另一个链表初始化当前链表
+ list otherlist = {1, 2, 3};
+ list mylist2(otherlist);
+
+ return 0;
+ }
+ ```
+
+2. **赋值和交换**:
+
+ ```cpp
+ // 赋值
+ mylist = otherlist;
+
+ // 用特定数量的元素或范围内的元素替换链表的内容
+ mylist.assign(5, 10); // 用5个值为10的元素替换mylist的内容
+
+ // 交换两个链表的内容
+ mylist.swap(otherlist);
+ ```
+
+3. **迭代器相关**:
+ ```cpp
+ // 使用迭代器访问元素
+ list::iterator it = mylist.begin();
+ for (; it != mylist.end(); ++it) {
+ cout << *it << " ";
+ }
+ ```
+
+4. **容量**:
+ ```cpp
+ // 判断链表是否为空
+ if (mylist.empty()) {
+ cout << "链表为空" << endl;
+ }
+
+ // 返回链表中元素的数量
+ cout << "链表中元素的数量:" << mylist.size() << endl;
+ ```
+
+5. **访问元素**:
+ ```cpp
+ // 返回第一个元素的引用
+ int firstElement = mylist.front();
+
+ // 返回最后一个元素的引用
+ int lastElement = mylist.back();
+ ```
+
+6. **修改容器**:
+ ```cpp
+ // 在链表的开头插入一个元素
+ mylist.push_front(100);
+
+ // 移除链表的第一个元素
+ mylist.pop_front();
+
+ // 在链表的末尾插入一个元素
+ mylist.push_back(200);
+
+ // 移除链表的最后一个元素
+ mylist.pop_back();
+
+ // 在指定位置插入一个或多个元素
+ list::iterator it = mylist.begin();
+ advance(it, 2); // 移动迭代器到第三个位置
+ mylist.insert(it, 777);
+
+ // 移除指定位置或范围内的一个或多个元素
+ it = mylist.begin();
+ advance(it, 1); // 移动迭代器到第二个位置
+ mylist.erase(it);
+
+ // 移除链表的所有元素
+ mylist.clear();
+ ```
+
+7. **其他操作**:
+ ```cpp
+ // 将另一个链表的元素移动到当前链表的指定位置
+ list anotherlist = {9, 8, 7};
+ list::iterator pos = mylist.begin();
+ advance(pos, 2); // 移动到第三个位置
+ mylist.splice(pos, anotherlist);
+
+ // 将两个有序链表合并为一个有序链表
+ list sortedlist1 = {1, 3, 5};
+ list sortedlist2 = {2, 4, 6};
+ sortedlist1.merge(sortedlist2);
+
+ // 对链表进行排序
+ mylist.sort();
+
+ // 反转链表中的元素顺序
+ mylist.reverse();
+ ```
+
diff --git a/notebook/docs/C++/8.map.md b/notebook/docs/C++/8.map.md
new file mode 100644
index 00000000..4a5c13ce
--- /dev/null
+++ b/notebook/docs/C++/8.map.md
@@ -0,0 +1,68 @@
+1. **构造函数**:
+ - `map()`:创建一个空的映射容器。
+ - `map(const map& other)`:拷贝构造函数,用另一个映射容器初始化当前映射容器。
+
+2. **赋值和交换**:
+ - `operator=`:将一个映射容器赋值给另一个映射容器。
+ - `assign`:用特定数量的键值对或范围内的键值对替换映射容器的内容。
+ - `swap`:交换两个映射容器的内容。
+
+3. **迭代器相关**:
+ - `begin`:返回指向第一个键值对的迭代器。
+ - `end`:返回指向最后一个键值对之后的位置的迭代器。
+
+4. **容量**:
+ - `empty`:判断映射容器是否为空。
+ - `size`:返回映射容器中键值对的数量。
+ - `max_size`:返回映射容器最大可容纳的键值对数量。
+
+5. **插入和访问元素**:
+ - `insert`:插入一个键值对或多个键值对。
+ - `erase`:移除指定键或范围内的键值对。
+ - `clear`:移除映射容器的所有键值对。
+ - `find`:查找指定键的迭代器。
+ - `operator[]`:访问映射容器中指定键对应的值。
+
+6. **其他操作**:
+ - `count`:返回指定键在映射容器中出现的次数。
+ - `lower_bound`:返回第一个不小于指定键的迭代器。
+ - `upper_bound`:返回第一个大于指定键的迭代器。
+
+```cpp
+#include
+#include