diff --git a/Algorithm/DP-DynamicProgramming/readme.md b/Algorithm/DP-DynamicProgramming/readme.md new file mode 100644 index 0000000..795c64b --- /dev/null +++ b/Algorithm/DP-DynamicProgramming/readme.md @@ -0,0 +1,141 @@ +是的,动态规划(Dynamic Programming,简称DP)确实可以被视为一种“优化的枚举”或“带记忆化的穷举搜索”,它通过避免重复计算来高效地解决具有重叠子问题和最优子结构的问题。至于你提到的“小情况不是最优解,大情况一定不是最优解”,这本质上是在描述DP中最优子结构(Optimal Substructure)的核心性质:如果子问题(小情况)的解不是最优的,那么由这些子问题构建的整体问题(大情况)的解也一定不会是最优。下面我一步步解释这个概念,并用例子说明如何理解和应用它。 + +### 1. **动态规划是什么?为什么说是“优化的枚举”?** + - **基本idea**:许多问题可以通过枚举所有可能的方式来求解(比如穷举所有路径或组合),但纯枚举往往效率低下(时间复杂度指数级)。DP通过识别问题的结构,将枚举过程优化为多项式时间复杂度。 + - **关键特性**: + - **重叠子问题(Overlapping Subproblems)**:同一个子问题会被多次求解。如果不优化,就会重复计算。DP用表格(数组)或记忆化(memoization)存储已计算的结果,避免重复。 + - **最优子结构**:整体问题的最优解可以由子问题的最优解组合而成。这允许我们从小规模问题逐步构建到大规模问题。 + - **与枚举的联系**:DP本质上是枚举所有可能的子问题解,但它“聪明”地只计算每个子问题一次,并用这些结果“组装”最终解。相比纯枚举,DP避免了指数级的冗余计算。 + + 简单说,DP不是魔法,它只是高效的“聪明枚举”。 + +### 2. **“小情况不是最优解,大情况一定不是最优解”——这是最优子结构的体现** + - **解释**:在具有最优子结构的问题中,整体最优解必须建立在所有子问题的最优解之上。如果你用了一个非最优的子问题解来构建整体解,那么整体解也必然不是最优的。这可以用反证法证明: + - 假设整体问题有一个最优解S,但其中某个子问题的解S_sub不是最优的。 + - 既然S_sub不是最优的,就存在一个更好的子问题解S_sub'(更优,比如成本更低或价值更高)。 + - 如果用S_sub'替换S中的S_sub,就能得到一个新的整体解S',它比S更好(因为子部分改进了,整体必然改进)。 + - 这与S是最优的假设矛盾。因此,S必须包含所有子问题的最优解。 + - **结论**:如果“小情况”(子问题)不是最优解,那么“大情况”(整体问题)一定不是最优解。这就是为什么DP算法总是先求解子问题的最优解,然后用它们构建更大问题的解。 + - **注意**:不是所有问题都满足最优子结构!比如某些图论问题(如最长路径问题)就不适合DP,因为它们没有这个性质(NP-hard)。DP只适用于那些天然具有这个结构的问题。 + +### 3. **如何应用这个概念?(以斐波那契数列为例)** + 斐波那契数列是一个经典的DP入门例子:F(n) = F(n-1) + F(n-2),F(1)=1, F(2)=1。它有重叠子问题(F(n-2)会被多次计算)和最优子结构(虽然这里不是“优化”问题,但结构类似:大问题的解由小问题的解直接相加)。 + + - **纯枚举(递归)方式**(无优化,效率低): + ```python + def fib(n): + if n <= 2: + return 1 + return fib(n-1) + fib(n-2) + ``` + 这会重复计算子问题,比如fib(5)会计算fib(3)两次。时间复杂度O(2^n),指数级。 + + - **DP优化(带记忆化或自底向上)**: + 我们用一个数组dp存储每个子问题的结果(小情况的最优解,这里是最准确的值)。 + - **步骤**: + 1. 定义状态:dp[i] 表示第i个斐波那契数(小情况的解)。 + 2. 初始化:dp[1] = 1, dp[2] = 1( base case,最小情况)。 + 3. 状态转移:对于更大i,dp[i] = dp[i-1] + dp[i-2](用小情况的最优解构建大情况)。 + 4. 求解:逐步填充dp,直到dp[n]。 + - **代码实现**(自底向上): + ```python + def fib_dp(n): + if n <= 2: + return 1 + dp = [0] * (n + 1) + dp[1] = 1 + dp[2] = 1 + for i in range(3, n + 1): + dp[i] = dp[i-1] + dp[i-2] # 用小情况构建大情况 + return dp[n] + ``` + 时间复杂度O(n),线性级。因为每个子问题只计算一次。 + + - **为什么体现你的问题**:如果某个小情况(如dp[3])不是“最优”(这里是最准确的值,比如误算成2而不是2),那么所有依赖它的更大情况(如dp[4]=dp[3]+dp[2])都会错,导致dp[n]一定不是正确解。这就是“小情况不优,大情况必不优”。 + +### 4. **另一个例子:0-1背包问题(优化问题)** + - **问题**:给定容量W的背包和n个物品(每个有重量w_i和价值v_i),求最大价值(不能拆分物品)。 + - **最优子结构**:考虑前i个物品、容量j的最优解dp[i][j] = max(不选第i个: dp[i-1][j], 选第i个: dp[i-1][j - w_i] + v_i)。 + - 如果某个子问题dp[i-1][j]不是最优价值,那么dp[i][j]也一定不是最优(因为它依赖于子问题的最大值)。 + - **DP步骤**: + 1. 定义dp[i][j]:前i物品、容量j的最大价值。 + 2. 初始化:dp[0][j]=0(无物品)。 + 3. 转移:如上。 + 4. 最终dp[n][W]是最优解。 + 这又是“优化的枚举”:枚举每个物品的选/不选,但用表格避免重复。 + +### 5. **总结和建议** + - 是的,DP就是优化的枚举,它依赖最优子结构来确保“小不优则大不优”。 + - 要判断一个问题是否适合DP:检查是否有重叠子问题和最优子结构。如果有,从小到大构建解。 + - 如果你有具体问题(如代码实现或某个算法),可以提供更多细节,我可以帮你细化或用代码演示! + +是的,严格来说,在使用动态规划(DP)之前,理论上需要确认问题具有**最优子结构**和**重叠子问题**这两个性质,以确保DP能够正确且高效地解决问题。特别是“最优子结构”是DP的核心基础,因为它保证了大问题的最优解可以由子问题的最优解推导出来(即“小情况不优,大情况必不优”)。不过,在实际应用中,证明最优子结构的过程有时可以简化,尤其是对于常见问题。下面我详细解释,并提供一些实用建议。 + +### 1. **为什么需要证明最优子结构?** + - **最优子结构的定义**:一个问题具有最优子结构,意味着整体问题的最优解可以通过子问题的最优解组合得到。如果子问题的解不是最优的,那么整体解也不会是最优的。 + - **为什么重要**:DP的核心是通过保存子问题的最优解(通常存在数组或记忆化表中),逐步构建大问题的解。如果问题没有最优子结构,用DP推导出的结果可能不正确(不是全局最优解),或者DP根本不适用。 + - **反例**:有些问题不具备最优子结构,比如图中的**最长简单路径问题**(Longest Simple Path)。因为路径的约束(不能重复经过点)导致大问题的解可能无法直接由子问题的最优解组合,DP通常不适合这类问题(它是NP-hard)。 + + 因此,证明最优子结构是为了确保DP的正确性:如果子问题的最优解不正确,基于它们的整体解也不会正确。 + +### 2. **如何证明最优子结构?** + 证明最优子结构通常通过**反证法**或**构造法**,以下是通用步骤: + 1. **假设整体最优解**:假设你找到了整体问题的一个最优解S(比如最大价值、最短路径等)。 + 2. **分解为子问题**:将S分解成依赖的子问题解S1, S2, ...(比如依赖前i-1个物品的解)。 + 3. **假设子问题非最优**:假设某个子问题S1不是最优解,存在一个更好的子问题解S1'(比如价值更高或路径更短)。 + 4. **替换构造**:用S1'替换S中的S1,构造一个新的整体解S'。由于S1'比S1更好,S'应该比S更好(比如总价值更高或总路径更短)。 + 5. **得出矛盾**:如果S是最优解,那么S'比S更好就矛盾了。因此,S1必须是最优的,证明了最优子结构。 + + **例子:0-1背包问题** + - 问题:n个物品,背包容量W,每个物品有重量w_i和价值v_i,求最大价值。 + - 证明最优子结构: + - 假设S是容量W、前n个物品的最大价值解(总价值V)。 + - S要么包含第n个物品,要么不包含: + - 若包含第n个(重量w_n, 价值v_n),则S由v_n和前n-1个物品在容量W-w_n的最大价值解S'组成。 + - 若S'不是W-w_n的最大价值解,存在S''(价值高于S'),则用S''替换S',得到新解S_new = v_n + S'',总价值高于V,矛盾! + - 若不包含第n个,则S由前n-1个物品在容量W的最大价值解组成,类似可证。 + - 结论:S依赖的子问题解必须是最优的,证明了最优子结构。 + +### 3. **实际中是否总是要严格证明?** + - **学术场景**:在研究新问题或设计新算法时,严格证明最优子结构和重叠子问题是必须的,以保证算法的正确性和适用性。 + - **工程/竞赛场景**:对于常见的DP问题(如背包、LCS、最短路径、矩阵链乘等),这些性质已经被前人验证过,通常不需要重新证明。你可以直接识别问题模式,套用标准DP模板。 + - **如何判断适用DP**: + - 检查问题是否能分解成子问题,且子问题会重复出现(重叠子问题)。 + - 检查大问题的解是否可以通过子问题的最优解组合(最优子结构)。这通常通过问题描述中的“最大”“最小”“最优”关键词来推测。 + - 如果不确定,可以尝试构造几个小规模案例,手动推导,看看是否满足“子问题最优→整体最优”。 + + **实用技巧**:如果问题看起来像“求最大/最小/最优解”且能分解成小的类似问题(比如前i个元素、长度为k的子串等),通常可以假设它有最优子结构,快速尝试DP方法。如果结果不对,再回过头检查性质。 + +### 4. **什么时候不需要DP?** + 如果问题没有最优子结构或重叠子问题,DP可能不适用: + - **无最优子结构**:如最长简单路径问题,子路径的最优解不一定能组合成全局最优。 + - **无重叠子问题**:如某些递归问题,子问题不重复,记忆化无意义,可能用普通递归或贪心更合适。 + - **复杂约束**:如果问题有全局约束(比如必须满足某些额外条件),可能需要其他方法(如回溯、图算法)。 + +### 5. **一个简化的例子:最短路径(单源无负权)** + - 问题:Dijkstra算法求单源最短路径(可以用DP思想理解)。 + - 最优子结构:到目标点t的最短路径必然包含到中间点u的最短路径。如果u到t的子路径不是最短的,替换成更短的子路径会使整体路径更短,矛盾。 + - DP实现:dp[v]表示到点v的最短距离,转移时用已知的最短路径更新其他点。 + + **代码片段**(Dijkstra的DP视角): + ```python + def dijkstra(graph, start, n): + dp = [float('inf')] * n # dp[i]表示到i的最短路径 + dp[start] = 0 + visited = [False] * n + for _ in range(n): + u = min((dp[i], i) for i in range(n) if not visited[i])[1] + visited[u] = True + for v, w in graph[u]: # 邻接表 + if dp[u] + w < dp[v]: # 用u的最优解更新v + dp[v] = dp[u] + w + return dp + ``` + 这里dp[v]依赖于子问题dp[u]的最优解,体现了最优子结构。 + +### 6. **总结与建议** + - 是的,使用DP前理论上需要确认最优子结构和重叠子问题,特别是对新问题。但对于常见问题(如背包、LCS、区间DP等),这些性质通常已知,可以直接套用。 + - 实际操作中,可以先根据问题特征(求最优、能分解)尝试DP设计状态和转移方程。如果结果不对,检查是否违反了最优子结构。 + - 如果你有具体问题(比如某个算法题),可以分享,我帮你分析是否适合DP、如何定义状态,或者是否需要证明最优子结构! + +你是否有某个具体问题想深入探讨?比如某个DP题的推导或实现? \ No newline at end of file diff --git a/Recursion/0Resursion 递归 b/Algorithm/Recursion/0Resursion 递归 similarity index 100% rename from Recursion/0Resursion 递归 rename to Algorithm/Recursion/0Resursion 递归 diff --git a/Recursion/P27_All_Sorted b/Algorithm/Recursion/P27_All_Sorted old mode 100755 new mode 100644 similarity index 100% rename from Recursion/P27_All_Sorted rename to Algorithm/Recursion/P27_All_Sorted diff --git a/Recursion/P27_All_Sorted.cpp b/Algorithm/Recursion/P27_All_Sorted.cpp similarity index 100% rename from Recursion/P27_All_Sorted.cpp rename to Algorithm/Recursion/P27_All_Sorted.cpp diff --git a/Recursion/P28_19_n!.cpp b/Algorithm/Recursion/P28_19_n!.cpp similarity index 100% rename from Recursion/P28_19_n!.cpp rename to Algorithm/Recursion/P28_19_n!.cpp diff --git a/Recursion/P28_19_n!.exe b/Algorithm/Recursion/P28_19_n!.exe similarity index 100% rename from Recursion/P28_19_n!.exe rename to Algorithm/Recursion/P28_19_n!.exe diff --git a/Recursion/P28_20_Feb.cpp b/Algorithm/Recursion/P28_20_Feb.cpp similarity index 100% rename from Recursion/P28_20_Feb.cpp rename to Algorithm/Recursion/P28_20_Feb.cpp diff --git a/Recursion/P28_20_Feb.exe b/Algorithm/Recursion/P28_20_Feb.exe similarity index 100% rename from Recursion/P28_20_Feb.exe rename to Algorithm/Recursion/P28_20_Feb.exe diff --git a/Recursion/P29_21_ComplexFunc.cpp b/Algorithm/Recursion/P29_21_ComplexFunc.cpp similarity index 100% rename from Recursion/P29_21_ComplexFunc.cpp rename to Algorithm/Recursion/P29_21_ComplexFunc.cpp diff --git a/Recursion/P29_21_ComplexFunc.exe b/Algorithm/Recursion/P29_21_ComplexFunc.exe similarity index 100% rename from Recursion/P29_21_ComplexFunc.exe rename to Algorithm/Recursion/P29_21_ComplexFunc.exe diff --git a/Recursion/P29_22_Ackermann.cpp b/Algorithm/Recursion/P29_22_Ackermann.cpp similarity index 100% rename from Recursion/P29_22_Ackermann.cpp rename to Algorithm/Recursion/P29_22_Ackermann.cpp diff --git a/Recursion/P29_22_Ackermann.exe b/Algorithm/Recursion/P29_22_Ackermann.exe similarity index 100% rename from Recursion/P29_22_Ackermann.exe rename to Algorithm/Recursion/P29_22_Ackermann.exe diff --git a/Recursion/P29_23_GCD.cpp b/Algorithm/Recursion/P29_23_GCD.cpp similarity index 100% rename from Recursion/P29_23_GCD.cpp rename to Algorithm/Recursion/P29_23_GCD.cpp diff --git a/Recursion/P29_23_GCD.exe b/Algorithm/Recursion/P29_23_GCD.exe similarity index 100% rename from Recursion/P29_23_GCD.exe rename to Algorithm/Recursion/P29_23_GCD.exe diff --git a/Recursion/P29_24_checkfunc.cpp b/Algorithm/Recursion/P29_24_checkfunc.cpp similarity index 100% rename from Recursion/P29_24_checkfunc.cpp rename to Algorithm/Recursion/P29_24_checkfunc.cpp diff --git a/Recursion/P29_24_checkfunc.exe b/Algorithm/Recursion/P29_24_checkfunc.exe similarity index 100% rename from Recursion/P29_24_checkfunc.exe rename to Algorithm/Recursion/P29_24_checkfunc.exe diff --git a/Recursion/P29_25_SubsetGen b/Algorithm/Recursion/P29_25_SubsetGen old mode 100755 new mode 100644 similarity index 100% rename from Recursion/P29_25_SubsetGen rename to Algorithm/Recursion/P29_25_SubsetGen diff --git a/Recursion/P29_25_SubsetGen.cpp b/Algorithm/Recursion/P29_25_SubsetGen.cpp similarity index 100% rename from Recursion/P29_25_SubsetGen.cpp rename to Algorithm/Recursion/P29_25_SubsetGen.cpp diff --git a/BinaryTree/BinaryTreeRealise/CMakeList的具体写法 b/Algorithm/Sort/readme.md similarity index 100% rename from BinaryTree/BinaryTreeRealise/CMakeList的具体写法 rename to Algorithm/Sort/readme.md diff --git a/Algorithm/readme.md b/Algorithm/readme.md new file mode 100644 index 0000000..9aa420b --- /dev/null +++ b/Algorithm/readme.md @@ -0,0 +1,170 @@ +你问的是“把所有的算法和其概念都列举一下”——这个范围其实**无限大** 🤯,因为“算法”不仅包括基础数据结构和经典问题(排序、查找、图算法等),还包括数论、密码学、机器学习、人工智能、分布式、量子计算里的算法。严格说全列举是不可能的。 + +不过我可以给你一个**系统的分类目录**,把常见且重要的算法类型和它们的基本概念总结出来,这样你能有一个“地图”,以后可以往下逐步展开。 + +--- + +## 📚 常见算法分类与概念 + +(从基础到进阶) + +### 1. **基础算法** + +* **排序算法** + + * 冒泡排序:相邻元素交换,O(n²)。 + * 插入排序:逐个插入到有序区间,O(n²)。 + * 选择排序:每次选择最小元素放到前面,O(n²)。 + * 归并排序:分治合并,O(n log n)。 + * 快速排序:分区 + 递归,O(n log n),最坏 O(n²)。 + * 堆排序:利用堆结构,O(n log n)。 + * 计数/桶/基数排序:非比较排序,O(n+k)。 + +* **查找算法** + + * 顺序查找:挨个比对。 + * 二分查找:有序数组,O(log n)。 + * 哈希查找:哈希表平均 O(1)。 + * 插值查找、斐波那契查找:二分的改进。 + +--- + +### 2. **递归与分治** + +* 概念:将问题分解为规模更小的同类问题,再合并解。 +* 典型:归并排序、快速排序、二分查找、矩阵乘法(Strassen)、棋盘覆盖、FFT。 + +--- + +### 3. **动态规划(DP)** + +* 概念:将大问题拆成重叠子问题,保存子问题解避免重复计算。 +* 典型: + + * 背包问题(0-1、多重、完全)。 + * 最长公共子序列 LCS。 + * 最长上升子序列 LIS。 + * 矩阵链乘。 + * 状压 DP(旅行商、集合覆盖)。 + * 树形 DP。 + +--- + +### 4. **贪心算法** + +* 概念:每一步都做局部最优选择,期望得到全局最优解。 +* 典型: + + * 活动选择问题。 + * Huffman 编码。 + * Kruskal / Prim(最小生成树)。 + * Dijkstra(单源最短路径)。 + +--- + +### 5. **图论算法** + +* **最短路径** + + * Dijkstra(非负权)。 + * Bellman-Ford(可处理负权)。 + * Floyd-Warshall(任意两点)。 + * A\*(启发式搜索)。 +* **最小生成树** + + * Kruskal。 + * Prim。 +* **最大流 / 最小割** + + * Ford-Fulkerson。 + * Edmonds-Karp。 + * Dinic。 +* **匹配 / 覆盖** + + * 匈牙利算法。 + * Hopcroft-Karp。 + +--- + +### 6. **数论与密码学算法** + +* 欧几里得算法(gcd)。 +* 扩展欧几里得(ax+by=gcd)。 +* 快速幂。 +* 素数筛法(埃拉托斯特尼筛、线性筛)。 +* RSA 加密(模幂运算)。 +* 椭圆曲线加密。 + +--- + +### 7. **搜索算法** + +* DFS(深度优先搜索)。 +* BFS(广度优先搜索)。 +* 回溯(N 皇后、数独)。 +* 分支限界法。 +* 启发式搜索(A\*、IDA\*)。 + +--- + +### 8. **字符串算法** + +* KMP(前缀函数)。 +* Rabin-Karp(哈希匹配)。 +* Trie 树(字典树)。 +* 后缀数组 / 后缀自动机 / 后缀树。 +* AC 自动机(多模式匹配)。 +* Manacher(回文子串)。 + +--- + +### 9. **几何算法** + +* 凸包(Graham 扫描、Andrew 算法)。 +* 线段相交判定。 +* 最近点对。 +* 扫描线算法。 +* 计算几何中的旋转卡壳。 + +--- + +### 10. **并行与分布式算法** + +* MapReduce。 +* Paxos、Raft(分布式一致性)。 +* 并行前缀和(scan)。 +* 并行排序。 + +--- + +### 11. **机器学习与 AI 算法** + +* 线性回归 / 逻辑回归。 +* 决策树 / 随机森林。 +* k-means 聚类。 +* 支持向量机。 +* 神经网络(BP 算法、梯度下降)。 +* 强化学习(Q-learning)。 + +--- + +### 12. **其他重要算法** + +* 并查集(Union-Find)。 +* 拓扑排序。 +* 位运算算法(lowbit、快速加法)。 +* 蒙特卡洛 / 拉斯维加斯(随机化算法)。 +* Bloom Filter。 +* 哈希算法(MD5, SHA)。 + +--- + +🔑 **总结**: + +* **算法的世界很大**,不同领域有成百上千种算法。 +* 学习顺序建议:**排序 → 查找 → 分治/递归 → DP → 贪心 → 图论 → 高级专题(字符串/几何/数论/AI)**。 +* 以后遇到具体领域(比如机器学习、密码学),再深入相关算法。 + +--- + +要不要我帮你整理一个 **“学习路线图”**(比如第一阶段学什么,第二阶段学什么),而不是一大堆罗列?这样更方便你系统掌握。 diff --git a/BinaryTree/BalanceTree/AVLTree/AVLTree的4中旋转方式.pdf b/Data-Structure/BinaryTree/BalanceTree/AVLTree/AVLTree的4中旋转方式.pdf similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/AVLTree的4中旋转方式.pdf rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/AVLTree的4中旋转方式.pdf diff --git a/BinaryTree/BalanceTree/AVLTree/CMakeLists.txt b/Data-Structure/BinaryTree/BalanceTree/AVLTree/CMakeLists.txt similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/CMakeLists.txt rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/CMakeLists.txt diff --git a/BinaryTree/BalanceTree/AVLTree/OutputLogic.pdf b/Data-Structure/BinaryTree/BalanceTree/AVLTree/OutputLogic.pdf similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/OutputLogic.pdf rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/OutputLogic.pdf diff --git a/BinaryTree/BalanceTree/AVLTree/README.MD b/Data-Structure/BinaryTree/BalanceTree/AVLTree/README.MD similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/README.MD rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/README.MD diff --git a/BinaryTree/BalanceTree/AVLTree/avl.h b/Data-Structure/BinaryTree/BalanceTree/AVLTree/avl.h similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/avl.h rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/avl.h diff --git a/BinaryTree/BalanceTree/AVLTree/main.cpp b/Data-Structure/BinaryTree/BalanceTree/AVLTree/main.cpp similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/main.cpp rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/main.cpp diff --git a/BinaryTree/BalanceTree/AVLTree/treenode.h b/Data-Structure/BinaryTree/BalanceTree/AVLTree/treenode.h similarity index 100% rename from BinaryTree/BalanceTree/AVLTree/treenode.h rename to Data-Structure/BinaryTree/BalanceTree/AVLTree/treenode.h diff --git a/BinaryTree/BalanceTree/B-Tree/B-Tree-By-AI.h b/Data-Structure/BinaryTree/BalanceTree/B-Tree/B-Tree-By-AI.h similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/B-Tree-By-AI.h rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/B-Tree-By-AI.h diff --git a/BinaryTree/BalanceTree/B-Tree/BTree.h b/Data-Structure/BinaryTree/BalanceTree/B-Tree/BTree.h similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/BTree.h rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/BTree.h diff --git a/BinaryTree/BalanceTree/B-Tree/Node.h b/Data-Structure/BinaryTree/BalanceTree/B-Tree/Node.h similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/Node.h rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/Node.h diff --git a/BinaryTree/BalanceTree/B-Tree/README.MD b/Data-Structure/BinaryTree/BalanceTree/B-Tree/README.MD similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/README.MD rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/README.MD diff --git a/BinaryTree/BalanceTree/B-Tree/img/erase/1.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/1.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/erase/1.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/1.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/erase/2.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/2.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/erase/2.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/2.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/erase/3.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/3.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/erase/3.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/3.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/erase/4.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/4.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/erase/4.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/4.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/erase/5.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/5.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/erase/5.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/5.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/erase/6.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/6.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/erase/6.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/erase/6.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/1.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/1.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/1.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/1.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/10.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/10.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/10.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/10.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/2.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/2.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/2.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/2.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/3.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/3.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/3.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/3.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/4.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/4.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/4.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/4.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/5.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/5.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/5.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/5.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/6.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/6.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/6.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/6.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/7.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/7.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/7.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/7.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/8.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/8.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/8.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/8.png diff --git a/BinaryTree/BalanceTree/B-Tree/img/insert/9.png b/Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/9.png similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/img/insert/9.png rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/img/insert/9.png diff --git a/BinaryTree/BalanceTree/B-Tree/main.cpp b/Data-Structure/BinaryTree/BalanceTree/B-Tree/main.cpp similarity index 100% rename from BinaryTree/BalanceTree/B-Tree/main.cpp rename to Data-Structure/BinaryTree/BalanceTree/B-Tree/main.cpp diff --git a/BinaryTree/BalanceTree/BPlus-Tree/BPlusTree.h b/Data-Structure/BinaryTree/BalanceTree/BPlus-Tree/BPlusTree.h similarity index 100% rename from BinaryTree/BalanceTree/BPlus-Tree/BPlusTree.h rename to Data-Structure/BinaryTree/BalanceTree/BPlus-Tree/BPlusTree.h diff --git a/BinaryTree/BalanceTree/BPlus-Tree/Node.h b/Data-Structure/BinaryTree/BalanceTree/BPlus-Tree/Node.h similarity index 100% rename from BinaryTree/BalanceTree/BPlus-Tree/Node.h rename to Data-Structure/BinaryTree/BalanceTree/BPlus-Tree/Node.h diff --git a/BinaryTree/BalanceTree/BPlus-Tree/main.cpp b/Data-Structure/BinaryTree/BalanceTree/BPlus-Tree/main.cpp similarity index 100% rename from BinaryTree/BalanceTree/BPlus-Tree/main.cpp rename to Data-Structure/BinaryTree/BalanceTree/BPlus-Tree/main.cpp diff --git a/BinaryTree/BalanceTree/README.MD b/Data-Structure/BinaryTree/BalanceTree/README.MD similarity index 100% rename from BinaryTree/BalanceTree/README.MD rename to Data-Structure/BinaryTree/BalanceTree/README.MD diff --git a/BinaryTree/BalanceTree/Red-Black Tree/RBTree.h b/Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/RBTree.h similarity index 100% rename from BinaryTree/BalanceTree/Red-Black Tree/RBTree.h rename to Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/RBTree.h diff --git a/BinaryTree/BalanceTree/Red-Black Tree/README.MD b/Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/README.MD similarity index 100% rename from BinaryTree/BalanceTree/Red-Black Tree/README.MD rename to Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/README.MD diff --git a/BinaryTree/BalanceTree/Red-Black Tree/TreeNode.h b/Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/TreeNode.h similarity index 100% rename from BinaryTree/BalanceTree/Red-Black Tree/TreeNode.h rename to Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/TreeNode.h diff --git a/BinaryTree/BalanceTree/Red-Black Tree/info.jpg b/Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/info.jpg similarity index 100% rename from BinaryTree/BalanceTree/Red-Black Tree/info.jpg rename to Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/info.jpg diff --git a/BinaryTree/BalanceTree/Red-Black Tree/main.cpp b/Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/main.cpp similarity index 100% rename from BinaryTree/BalanceTree/Red-Black Tree/main.cpp rename to Data-Structure/BinaryTree/BalanceTree/Red-Black Tree/main.cpp diff --git a/BinaryTree/BinaryTreeRealise/CMakeLists.txt b/Data-Structure/BinaryTree/BinaryTreeRealise/CMakeLists.txt similarity index 100% rename from BinaryTree/BinaryTreeRealise/CMakeLists.txt rename to Data-Structure/BinaryTree/BinaryTreeRealise/CMakeLists.txt diff --git a/BinaryTree/priorityQueue/maxHBLT/Height-biased Leftist Tree b/Data-Structure/BinaryTree/BinaryTreeRealise/CMakeList的具体写法 similarity index 100% rename from BinaryTree/priorityQueue/maxHBLT/Height-biased Leftist Tree rename to Data-Structure/BinaryTree/BinaryTreeRealise/CMakeList的具体写法 diff --git a/BinaryTree/BinaryTreeRealise/binaryTree.h b/Data-Structure/BinaryTree/BinaryTreeRealise/binaryTree.h similarity index 100% rename from BinaryTree/BinaryTreeRealise/binaryTree.h rename to Data-Structure/BinaryTree/BinaryTreeRealise/binaryTree.h diff --git a/BinaryTree/BinaryTreeRealise/binaryTreeNode.h b/Data-Structure/BinaryTree/BinaryTreeRealise/binaryTreeNode.h similarity index 100% rename from BinaryTree/BinaryTreeRealise/binaryTreeNode.h rename to Data-Structure/BinaryTree/BinaryTreeRealise/binaryTreeNode.h diff --git a/BinaryTree/BinaryTreeRealise/linkedBinaryTree.h b/Data-Structure/BinaryTree/BinaryTreeRealise/linkedBinaryTree.h similarity index 100% rename from BinaryTree/BinaryTreeRealise/linkedBinaryTree.h rename to Data-Structure/BinaryTree/BinaryTreeRealise/linkedBinaryTree.h diff --git a/BinaryTree/BinaryTreeRealise/main.cpp b/Data-Structure/BinaryTree/BinaryTreeRealise/main.cpp similarity index 100% rename from BinaryTree/BinaryTreeRealise/main.cpp rename to Data-Structure/BinaryTree/BinaryTreeRealise/main.cpp diff --git a/BinaryTree/indexBinarySearchTree/CMakeLists.txt b/Data-Structure/BinaryTree/indexBinarySearchTree/CMakeLists.txt similarity index 100% rename from BinaryTree/indexBinarySearchTree/CMakeLists.txt rename to Data-Structure/BinaryTree/indexBinarySearchTree/CMakeLists.txt diff --git a/BinaryTree/indexBinarySearchTree/binaryTreeNode.h b/Data-Structure/BinaryTree/indexBinarySearchTree/binaryTreeNode.h similarity index 100% rename from BinaryTree/indexBinarySearchTree/binaryTreeNode.h rename to Data-Structure/BinaryTree/indexBinarySearchTree/binaryTreeNode.h diff --git a/BinaryTree/indexBinarySearchTree/indexBinarySearchTree.h b/Data-Structure/BinaryTree/indexBinarySearchTree/indexBinarySearchTree.h similarity index 100% rename from BinaryTree/indexBinarySearchTree/indexBinarySearchTree.h rename to Data-Structure/BinaryTree/indexBinarySearchTree/indexBinarySearchTree.h diff --git a/BinaryTree/indexBinarySearchTree/main.cpp b/Data-Structure/BinaryTree/indexBinarySearchTree/main.cpp similarity index 100% rename from BinaryTree/indexBinarySearchTree/main.cpp rename to Data-Structure/BinaryTree/indexBinarySearchTree/main.cpp diff --git a/BinaryTree/priorityQueue/README.MD b/Data-Structure/BinaryTree/priorityQueue/README.MD similarity index 100% rename from BinaryTree/priorityQueue/README.MD rename to Data-Structure/BinaryTree/priorityQueue/README.MD diff --git a/BinaryTree/priorityQueue/maxHBLT/CMakeLists.txt b/Data-Structure/BinaryTree/priorityQueue/maxHBLT/CMakeLists.txt similarity index 100% rename from BinaryTree/priorityQueue/maxHBLT/CMakeLists.txt rename to Data-Structure/BinaryTree/priorityQueue/maxHBLT/CMakeLists.txt diff --git a/BinaryTree/priorityQueue/maxWBLT/WBLT b/Data-Structure/BinaryTree/priorityQueue/maxHBLT/Height-biased Leftist Tree similarity index 100% rename from BinaryTree/priorityQueue/maxWBLT/WBLT rename to Data-Structure/BinaryTree/priorityQueue/maxHBLT/Height-biased Leftist Tree diff --git a/BinaryTree/priorityQueue/maxHBLT/README.MD b/Data-Structure/BinaryTree/priorityQueue/maxHBLT/README.MD similarity index 100% rename from BinaryTree/priorityQueue/maxHBLT/README.MD rename to Data-Structure/BinaryTree/priorityQueue/maxHBLT/README.MD diff --git a/BinaryTree/priorityQueue/maxHBLT/binaryTreeNode.h b/Data-Structure/BinaryTree/priorityQueue/maxHBLT/binaryTreeNode.h similarity index 100% rename from BinaryTree/priorityQueue/maxHBLT/binaryTreeNode.h rename to Data-Structure/BinaryTree/priorityQueue/maxHBLT/binaryTreeNode.h diff --git a/BinaryTree/priorityQueue/maxHBLT/main.cpp b/Data-Structure/BinaryTree/priorityQueue/maxHBLT/main.cpp similarity index 100% rename from BinaryTree/priorityQueue/maxHBLT/main.cpp rename to Data-Structure/BinaryTree/priorityQueue/maxHBLT/main.cpp diff --git a/BinaryTree/priorityQueue/maxHBLT/maxHblt.h b/Data-Structure/BinaryTree/priorityQueue/maxHBLT/maxHblt.h similarity index 100% rename from BinaryTree/priorityQueue/maxHBLT/maxHblt.h rename to Data-Structure/BinaryTree/priorityQueue/maxHBLT/maxHblt.h diff --git a/BinaryTree/priorityQueue/maxHeap/CMakeLists.txt b/Data-Structure/BinaryTree/priorityQueue/maxHeap/CMakeLists.txt similarity index 100% rename from BinaryTree/priorityQueue/maxHeap/CMakeLists.txt rename to Data-Structure/BinaryTree/priorityQueue/maxHeap/CMakeLists.txt diff --git a/BinaryTree/priorityQueue/maxHeap/main.cpp b/Data-Structure/BinaryTree/priorityQueue/maxHeap/main.cpp similarity index 100% rename from BinaryTree/priorityQueue/maxHeap/main.cpp rename to Data-Structure/BinaryTree/priorityQueue/maxHeap/main.cpp diff --git a/BinaryTree/priorityQueue/maxHeap/maxHeap.h b/Data-Structure/BinaryTree/priorityQueue/maxHeap/maxHeap.h similarity index 100% rename from BinaryTree/priorityQueue/maxHeap/maxHeap.h rename to Data-Structure/BinaryTree/priorityQueue/maxHeap/maxHeap.h diff --git a/BinaryTree/priorityQueue/maxWBLT/CMakeLists.txt b/Data-Structure/BinaryTree/priorityQueue/maxWBLT/CMakeLists.txt similarity index 100% rename from BinaryTree/priorityQueue/maxWBLT/CMakeLists.txt rename to Data-Structure/BinaryTree/priorityQueue/maxWBLT/CMakeLists.txt diff --git a/LinearList/Queue/chainQueue/p211 b/Data-Structure/BinaryTree/priorityQueue/maxWBLT/WBLT similarity index 100% rename from LinearList/Queue/chainQueue/p211 rename to Data-Structure/BinaryTree/priorityQueue/maxWBLT/WBLT diff --git a/BinaryTree/priorityQueue/maxWBLT/binaryTreeNode.h b/Data-Structure/BinaryTree/priorityQueue/maxWBLT/binaryTreeNode.h similarity index 100% rename from BinaryTree/priorityQueue/maxWBLT/binaryTreeNode.h rename to Data-Structure/BinaryTree/priorityQueue/maxWBLT/binaryTreeNode.h diff --git a/BinaryTree/priorityQueue/maxWBLT/main.cpp b/Data-Structure/BinaryTree/priorityQueue/maxWBLT/main.cpp similarity index 100% rename from BinaryTree/priorityQueue/maxWBLT/main.cpp rename to Data-Structure/BinaryTree/priorityQueue/maxWBLT/main.cpp diff --git a/BinaryTree/priorityQueue/maxWBLT/maxWBLT.h b/Data-Structure/BinaryTree/priorityQueue/maxWBLT/maxWBLT.h similarity index 100% rename from BinaryTree/priorityQueue/maxWBLT/maxWBLT.h rename to Data-Structure/BinaryTree/priorityQueue/maxWBLT/maxWBLT.h diff --git a/BinaryTree/priorityQueue/priorityQueueArray/CMakeLists.txt b/Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/CMakeLists.txt similarity index 100% rename from BinaryTree/priorityQueue/priorityQueueArray/CMakeLists.txt rename to Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/CMakeLists.txt diff --git a/BinaryTree/priorityQueue/priorityQueueArray/main.cpp b/Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/main.cpp similarity index 100% rename from BinaryTree/priorityQueue/priorityQueueArray/main.cpp rename to Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/main.cpp diff --git a/BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueue.h b/Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueue.h similarity index 100% rename from BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueue.h rename to Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueue.h diff --git a/BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueueRealise.h b/Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueueRealise.h similarity index 100% rename from BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueueRealise.h rename to Data-Structure/BinaryTree/priorityQueue/priorityQueueArray/maxPriorityQueueRealise.h diff --git a/BinaryTree/tournamentTree/LoserTree/CMakeLists.txt b/Data-Structure/BinaryTree/tournamentTree/LoserTree/CMakeLists.txt similarity index 100% rename from BinaryTree/tournamentTree/LoserTree/CMakeLists.txt rename to Data-Structure/BinaryTree/tournamentTree/LoserTree/CMakeLists.txt diff --git a/BinaryTree/tournamentTree/LoserTree/CreativePoint.png b/Data-Structure/BinaryTree/tournamentTree/LoserTree/CreativePoint.png similarity index 100% rename from BinaryTree/tournamentTree/LoserTree/CreativePoint.png rename to Data-Structure/BinaryTree/tournamentTree/LoserTree/CreativePoint.png diff --git a/BinaryTree/tournamentTree/LoserTree/main.cpp b/Data-Structure/BinaryTree/tournamentTree/LoserTree/main.cpp similarity index 100% rename from BinaryTree/tournamentTree/LoserTree/main.cpp rename to Data-Structure/BinaryTree/tournamentTree/LoserTree/main.cpp diff --git a/BinaryTree/tournamentTree/LoserTree/winnerTree.h b/Data-Structure/BinaryTree/tournamentTree/LoserTree/winnerTree.h similarity index 100% rename from BinaryTree/tournamentTree/LoserTree/winnerTree.h rename to Data-Structure/BinaryTree/tournamentTree/LoserTree/winnerTree.h diff --git a/BinaryTree/tournamentTree/WinnerTree/CMakeLists.txt b/Data-Structure/BinaryTree/tournamentTree/WinnerTree/CMakeLists.txt similarity index 100% rename from BinaryTree/tournamentTree/WinnerTree/CMakeLists.txt rename to Data-Structure/BinaryTree/tournamentTree/WinnerTree/CMakeLists.txt diff --git a/BinaryTree/tournamentTree/WinnerTree/CreativePoint.png b/Data-Structure/BinaryTree/tournamentTree/WinnerTree/CreativePoint.png similarity index 100% rename from BinaryTree/tournamentTree/WinnerTree/CreativePoint.png rename to Data-Structure/BinaryTree/tournamentTree/WinnerTree/CreativePoint.png diff --git a/BinaryTree/tournamentTree/WinnerTree/main.cpp b/Data-Structure/BinaryTree/tournamentTree/WinnerTree/main.cpp similarity index 100% rename from BinaryTree/tournamentTree/WinnerTree/main.cpp rename to Data-Structure/BinaryTree/tournamentTree/WinnerTree/main.cpp diff --git a/BinaryTree/tournamentTree/WinnerTree/winnerTree.h b/Data-Structure/BinaryTree/tournamentTree/WinnerTree/winnerTree.h similarity index 100% rename from BinaryTree/tournamentTree/WinnerTree/winnerTree.h rename to Data-Structure/BinaryTree/tournamentTree/WinnerTree/winnerTree.h diff --git a/Graph/adjacencyMatrix/adjacencyMatrix.h b/Data-Structure/Graph/adjacencyMatrix/adjacencyMatrix.h similarity index 100% rename from Graph/adjacencyMatrix/adjacencyMatrix.h rename to Data-Structure/Graph/adjacencyMatrix/adjacencyMatrix.h diff --git a/Graph/adjacencyMatrix/graph.h b/Data-Structure/Graph/adjacencyMatrix/graph.h similarity index 100% rename from Graph/adjacencyMatrix/graph.h rename to Data-Structure/Graph/adjacencyMatrix/graph.h diff --git a/Graph/adjacencyMatrix/main.cpp b/Data-Structure/Graph/adjacencyMatrix/main.cpp similarity index 100% rename from Graph/adjacencyMatrix/main.cpp rename to Data-Structure/Graph/adjacencyMatrix/main.cpp diff --git a/Graph/adjacencyMatrix/vertexIterator.h b/Data-Structure/Graph/adjacencyMatrix/vertexIterator.h similarity index 100% rename from Graph/adjacencyMatrix/vertexIterator.h rename to Data-Structure/Graph/adjacencyMatrix/vertexIterator.h diff --git a/Hash/hashArray/hashTable.h b/Data-Structure/Hash/hashArray/hashTable.h similarity index 100% rename from Hash/hashArray/hashTable.h rename to Data-Structure/Hash/hashArray/hashTable.h diff --git a/Hash/hashArray/main.cpp b/Data-Structure/Hash/hashArray/main.cpp similarity index 100% rename from Hash/hashArray/main.cpp rename to Data-Structure/Hash/hashArray/main.cpp diff --git a/LinearList/Dictionary/Implementation of the Dictionary Interface b/Data-Structure/LinearList/Dictionary/Implementation of the Dictionary Interface similarity index 100% rename from LinearList/Dictionary/Implementation of the Dictionary Interface rename to Data-Structure/LinearList/Dictionary/Implementation of the Dictionary Interface diff --git a/LinearList/Dictionary/sortedArrayList/dictionary.h b/Data-Structure/LinearList/Dictionary/sortedArrayList/dictionary.h similarity index 100% rename from LinearList/Dictionary/sortedArrayList/dictionary.h rename to Data-Structure/LinearList/Dictionary/sortedArrayList/dictionary.h diff --git a/LinearList/Dictionary/sortedArrayList/main.cpp b/Data-Structure/LinearList/Dictionary/sortedArrayList/main.cpp similarity index 100% rename from LinearList/Dictionary/sortedArrayList/main.cpp rename to Data-Structure/LinearList/Dictionary/sortedArrayList/main.cpp diff --git a/LinearList/Dictionary/sortedArrayList/sortedArrayList.h b/Data-Structure/LinearList/Dictionary/sortedArrayList/sortedArrayList.h similarity index 100% rename from LinearList/Dictionary/sortedArrayList/sortedArrayList.h rename to Data-Structure/LinearList/Dictionary/sortedArrayList/sortedArrayList.h diff --git a/LinearList/Queue/arrayQueue/arrayQueue.h b/Data-Structure/LinearList/Queue/arrayQueue/arrayQueue.h similarity index 100% rename from LinearList/Queue/arrayQueue/arrayQueue.h rename to Data-Structure/LinearList/Queue/arrayQueue/arrayQueue.h diff --git a/LinearList/Queue/arrayQueue/main.cpp b/Data-Structure/LinearList/Queue/arrayQueue/main.cpp similarity index 100% rename from LinearList/Queue/arrayQueue/main.cpp rename to Data-Structure/LinearList/Queue/arrayQueue/main.cpp diff --git a/LinearList/Queue/arrayQueue/queue.h b/Data-Structure/LinearList/Queue/arrayQueue/queue.h similarity index 100% rename from LinearList/Queue/arrayQueue/queue.h rename to Data-Structure/LinearList/Queue/arrayQueue/queue.h diff --git a/LinearList/skipList/skipList跳表 b/Data-Structure/LinearList/Queue/chainQueue/p211 similarity index 100% rename from LinearList/skipList/skipList跳表 rename to Data-Structure/LinearList/Queue/chainQueue/p211 diff --git a/LinearList/Stack/appliance/StarRail.cpp b/Data-Structure/LinearList/Stack/appliance/StarRail.cpp similarity index 100% rename from LinearList/Stack/appliance/StarRail.cpp rename to Data-Structure/LinearList/Stack/appliance/StarRail.cpp diff --git a/LinearList/Stack/appliance/braket-match.cpp b/Data-Structure/LinearList/Stack/appliance/braket-match.cpp similarity index 100% rename from LinearList/Stack/appliance/braket-match.cpp rename to Data-Structure/LinearList/Stack/appliance/braket-match.cpp diff --git a/LinearList/Stack/appliance/braket-match.exe b/Data-Structure/LinearList/Stack/appliance/braket-match.exe similarity index 100% rename from LinearList/Stack/appliance/braket-match.exe rename to Data-Structure/LinearList/Stack/appliance/braket-match.exe diff --git a/LinearList/Stack/appliance/hanoi.cpp b/Data-Structure/LinearList/Stack/appliance/hanoi.cpp similarity index 100% rename from LinearList/Stack/appliance/hanoi.cpp rename to Data-Structure/LinearList/Stack/appliance/hanoi.cpp diff --git a/LinearList/Stack/appliance/hanoi.exe b/Data-Structure/LinearList/Stack/appliance/hanoi.exe similarity index 100% rename from LinearList/Stack/appliance/hanoi.exe rename to Data-Structure/LinearList/Stack/appliance/hanoi.exe diff --git a/LinearList/Stack/arrayStack/arraystack.h b/Data-Structure/LinearList/Stack/arrayStack/arraystack.h similarity index 100% rename from LinearList/Stack/arrayStack/arraystack.h rename to Data-Structure/LinearList/Stack/arrayStack/arraystack.h diff --git a/LinearList/Stack/arrayStack/main.cpp b/Data-Structure/LinearList/Stack/arrayStack/main.cpp similarity index 100% rename from LinearList/Stack/arrayStack/main.cpp rename to Data-Structure/LinearList/Stack/arrayStack/main.cpp diff --git a/LinearList/Stack/arrayStack/stack.h b/Data-Structure/LinearList/Stack/arrayStack/stack.h similarity index 100% rename from LinearList/Stack/arrayStack/stack.h rename to Data-Structure/LinearList/Stack/arrayStack/stack.h diff --git a/LinearList/Stack/chainStack/chainStack.h b/Data-Structure/LinearList/Stack/chainStack/chainStack.h similarity index 100% rename from LinearList/Stack/chainStack/chainStack.h rename to Data-Structure/LinearList/Stack/chainStack/chainStack.h diff --git a/LinearList/Stack/chainStack/main.cpp b/Data-Structure/LinearList/Stack/chainStack/main.cpp similarity index 100% rename from LinearList/Stack/chainStack/main.cpp rename to Data-Structure/LinearList/Stack/chainStack/main.cpp diff --git a/LinearList/Stack/chainStack/node.h b/Data-Structure/LinearList/Stack/chainStack/node.h similarity index 100% rename from LinearList/Stack/chainStack/node.h rename to Data-Structure/LinearList/Stack/chainStack/node.h diff --git a/LinearList/Stack/chainStack/stack.h b/Data-Structure/LinearList/Stack/chainStack/stack.h similarity index 100% rename from LinearList/Stack/chainStack/stack.h rename to Data-Structure/LinearList/Stack/chainStack/stack.h diff --git a/LinearList/arrayList/arrayList.cpp b/Data-Structure/LinearList/arrayList/arrayList.cpp similarity index 100% rename from LinearList/arrayList/arrayList.cpp rename to Data-Structure/LinearList/arrayList/arrayList.cpp diff --git a/LinearList/arrayList/arrayList.h b/Data-Structure/LinearList/arrayList/arrayList.h similarity index 100% rename from LinearList/arrayList/arrayList.h rename to Data-Structure/LinearList/arrayList/arrayList.h diff --git a/LinearList/arrayList/linearList.h b/Data-Structure/LinearList/arrayList/linearList.h similarity index 100% rename from LinearList/arrayList/linearList.h rename to Data-Structure/LinearList/arrayList/linearList.h diff --git a/LinearList/arrayList/main.cpp b/Data-Structure/LinearList/arrayList/main.cpp similarity index 100% rename from LinearList/arrayList/main.cpp rename to Data-Structure/LinearList/arrayList/main.cpp diff --git a/LinearList/chainList/chain.h b/Data-Structure/LinearList/chainList/chain.h similarity index 100% rename from LinearList/chainList/chain.h rename to Data-Structure/LinearList/chainList/chain.h diff --git a/LinearList/chainList/chainNode.h b/Data-Structure/LinearList/chainList/chainNode.h similarity index 100% rename from LinearList/chainList/chainNode.h rename to Data-Structure/LinearList/chainList/chainNode.h diff --git a/LinearList/chainList/linearList.h b/Data-Structure/LinearList/chainList/linearList.h similarity index 100% rename from LinearList/chainList/linearList.h rename to Data-Structure/LinearList/chainList/linearList.h diff --git a/LinearList/chainList/main.cpp b/Data-Structure/LinearList/chainList/main.cpp similarity index 100% rename from LinearList/chainList/main.cpp rename to Data-Structure/LinearList/chainList/main.cpp diff --git a/LinearList/skipList/main.cpp b/Data-Structure/LinearList/skipList/main.cpp similarity index 100% rename from LinearList/skipList/main.cpp rename to Data-Structure/LinearList/skipList/main.cpp diff --git a/LinearList/skipList/skipList.h b/Data-Structure/LinearList/skipList/skipList.h similarity index 100% rename from LinearList/skipList/skipList.h rename to Data-Structure/LinearList/skipList/skipList.h diff --git a/Data-Structure/LinearList/skipList/skipList跳表 b/Data-Structure/LinearList/skipList/skipList跳表 new file mode 100644 index 0000000..e69de29 diff --git a/LinearList/skipList/skipNode.h b/Data-Structure/LinearList/skipList/skipNode.h similarity index 100% rename from LinearList/skipList/skipNode.h rename to Data-Structure/LinearList/skipList/skipNode.h diff --git a/LinearList/skipList/sl.cpp b/Data-Structure/LinearList/skipList/sl.cpp similarity index 100% rename from LinearList/skipList/sl.cpp rename to Data-Structure/LinearList/skipList/sl.cpp diff --git a/Matrix/main.cpp b/Data-Structure/Matrix/main.cpp similarity index 100% rename from Matrix/main.cpp rename to Data-Structure/Matrix/main.cpp diff --git a/Matrix/matrix.h b/Data-Structure/Matrix/matrix.h similarity index 100% rename from Matrix/matrix.h rename to Data-Structure/Matrix/matrix.h diff --git a/特性/auto自动推导.MD b/Features-Cpp/C11/auto自动推导.MD similarity index 100% rename from 特性/auto自动推导.MD rename to Features-Cpp/C11/auto自动推导.MD diff --git a/特性/lambda函数.MD b/Features-Cpp/C11/lambda函数.MD similarity index 100% rename from 特性/lambda函数.MD rename to Features-Cpp/C11/lambda函数.MD diff --git a/std/PATH.MD b/std-Cpp/PATH.MD similarity index 100% rename from std/PATH.MD rename to std-Cpp/PATH.MD diff --git a/std/README.MD b/std-Cpp/README.MD similarity index 100% rename from std/README.MD rename to std-Cpp/README.MD diff --git a/STL/README.MD b/std-Cpp/STL/README.MD similarity index 100% rename from STL/README.MD rename to std-Cpp/STL/README.MD diff --git a/STL/STL-Algorithm/README.MD b/std-Cpp/STL/STL-Algorithm/README.MD similarity index 100% rename from STL/STL-Algorithm/README.MD rename to std-Cpp/STL/STL-Algorithm/README.MD diff --git a/STL/STL-Deque/README.MD b/std-Cpp/STL/STL-Deque/README.MD similarity index 100% rename from STL/STL-Deque/README.MD rename to std-Cpp/STL/STL-Deque/README.MD diff --git a/STL/STL-Deque/deque.cpp b/std-Cpp/STL/STL-Deque/deque.cpp similarity index 100% rename from STL/STL-Deque/deque.cpp rename to std-Cpp/STL/STL-Deque/deque.cpp diff --git a/STL/STL-List/README.MD b/std-Cpp/STL/STL-List/README.MD similarity index 100% rename from STL/STL-List/README.MD rename to std-Cpp/STL/STL-List/README.MD diff --git a/STL/STL-List/main.cpp b/std-Cpp/STL/STL-List/main.cpp similarity index 100% rename from STL/STL-List/main.cpp rename to std-Cpp/STL/STL-List/main.cpp diff --git a/STL/STL-String/README.md b/std-Cpp/STL/STL-String/README.md similarity index 100% rename from STL/STL-String/README.md rename to std-Cpp/STL/STL-String/README.md diff --git a/STL/STL-String/string.cpp b/std-Cpp/STL/STL-String/string.cpp similarity index 100% rename from STL/STL-String/string.cpp rename to std-Cpp/STL/STL-String/string.cpp diff --git a/STL/STL-Vector/README.md b/std-Cpp/STL/STL-Vector/README.md similarity index 100% rename from STL/STL-Vector/README.md rename to std-Cpp/STL/STL-Vector/README.md diff --git a/STL/STL-Vector/define.cpp b/std-Cpp/STL/STL-Vector/define.cpp similarity index 100% rename from STL/STL-Vector/define.cpp rename to std-Cpp/STL/STL-Vector/define.cpp diff --git a/STL/STL-map/README.MD b/std-Cpp/STL/STL-map/README.MD similarity index 100% rename from STL/STL-map/README.MD rename to std-Cpp/STL/STL-map/README.MD diff --git a/STL/STL-map/map.cpp b/std-Cpp/STL/STL-map/map.cpp similarity index 100% rename from STL/STL-map/map.cpp rename to std-Cpp/STL/STL-map/map.cpp diff --git a/STL/STL-map/multimap.cpp b/std-Cpp/STL/STL-map/multimap.cpp similarity index 100% rename from STL/STL-map/multimap.cpp rename to std-Cpp/STL/STL-map/multimap.cpp diff --git a/STL/STL-map/multimap.exe b/std-Cpp/STL/STL-map/multimap.exe similarity index 100% rename from STL/STL-map/multimap.exe rename to std-Cpp/STL/STL-map/multimap.exe diff --git a/STL/STL-priority_queue/README.MD b/std-Cpp/STL/STL-priority_queue/README.MD similarity index 100% rename from STL/STL-priority_queue/README.MD rename to std-Cpp/STL/STL-priority_queue/README.MD diff --git a/STL/STL-priority_queue/main.cpp b/std-Cpp/STL/STL-priority_queue/main.cpp similarity index 100% rename from STL/STL-priority_queue/main.cpp rename to std-Cpp/STL/STL-priority_queue/main.cpp diff --git a/STL/STL-Set/README.MD b/std-Cpp/STL/STL-set/README.MD similarity index 100% rename from STL/STL-Set/README.MD rename to std-Cpp/STL/STL-set/README.MD diff --git a/STL/STL-Set/multiset.cpp b/std-Cpp/STL/STL-set/multiset.cpp similarity index 100% rename from STL/STL-Set/multiset.cpp rename to std-Cpp/STL/STL-set/multiset.cpp diff --git a/STL/STL-Set/set.cpp b/std-Cpp/STL/STL-set/set.cpp similarity index 100% rename from STL/STL-Set/set.cpp rename to std-Cpp/STL/STL-set/set.cpp diff --git a/STL/STL-unordered_map/README.MD b/std-Cpp/STL/STL-unordered_map/README.MD similarity index 100% rename from STL/STL-unordered_map/README.MD rename to std-Cpp/STL/STL-unordered_map/README.MD diff --git a/STL/STL-unordered_map/unordered_map.cpp b/std-Cpp/STL/STL-unordered_map/unordered_map.cpp similarity index 100% rename from STL/STL-unordered_map/unordered_map.cpp rename to std-Cpp/STL/STL-unordered_map/unordered_map.cpp diff --git a/STL/STL-unordered_map/unordered_multimap.cpp b/std-Cpp/STL/STL-unordered_map/unordered_multimap.cpp similarity index 100% rename from STL/STL-unordered_map/unordered_multimap.cpp rename to std-Cpp/STL/STL-unordered_map/unordered_multimap.cpp diff --git a/STL/STL-unordered_set/README.MD b/std-Cpp/STL/STL-unordered_set/README.MD similarity index 100% rename from STL/STL-unordered_set/README.MD rename to std-Cpp/STL/STL-unordered_set/README.MD diff --git a/std-Cpp/regex/readme.md b/std-Cpp/regex/readme.md new file mode 100644 index 0000000..2989e85 --- /dev/null +++ b/std-Cpp/regex/readme.md @@ -0,0 +1 @@ +
正则字符 | 描述 |
---|---|
\ | 将下一个字符标记为一个特殊字符、或一个原义字符、或一个向后引用、或一个八进制转义符。例如,“n "匹配字符"n "。"\n "匹配一个换行符。串行"\\ "匹配"\ "而"\( "则匹配"( "。 |
^ | 匹配输入字符串的开始位置。如果设置了RegExp对象的Multiline属性,^也匹配“\n "或"\r "之后的位置。 |
$ | 匹配输入字符串的结束位置。如果设置了RegExp对象的Multiline属性,$也匹配“\n "或"\r "之前的位置。 |
* | 匹配前面的子表达式零次或多次。例如,zo*能匹配“z "以及"zoo "。*等价于{0,}。 |
+ | 匹配前面的子表达式一次或多次。例如,“zo+ "能匹配"zo "以及"zoo ",但不能匹配"z "。+等价于{1,}。 |
? | 匹配前面的子表达式零次或一次。例如,“do(es)? "可以匹配"does "或"does "中的"do "。?等价于{0,1}。 |
{n} | n是一个非负整数。匹配确定的n次。例如,“o{2} "不能匹配"Bob "中的"o ",但是能匹配"food "中的两个o。 |
{n,} | n是一个非负整数。至少匹配n次。例如,“o{2,} "不能匹配"Bob "中的"o ",但能匹配"foooood "中的所有o。"o{1,} "等价于"o+ "。"o{0,} "则等价于"o* "。 |
{n,m} | m和n均为非负整数,其中n<=m。最少匹配n次且最多匹配m次。例如,“o{1,3} "将匹配"fooooood "中的前三个o。"o{0,1} "等价于"o? "。请注意在逗号和两个数之间不能有空格。 |
? | 当该字符紧跟在任何一个其他限制符(*,+,?,{n},{n,},{n,m})后面时,匹配模式是非贪婪的。非贪婪模式尽可能少的匹配所搜索的字符串,而默认的贪婪模式则尽可能多的匹配所搜索的字符串。例如,对于字符串“oooo ","o+? "将匹配单个"o ",而"o+ "将匹配所有"o "。 |
. | 匹配除“\ n "之外的任何单个字符。要匹配包括"\ n "在内的任何字符,请使用像"(.|\n) "的模式。 |
(pattern) | 匹配pattern并获取这一匹配。所获取的匹配可以从产生的Matches集合得到,在VBScript中使用SubMatches集合,在JScript中则使用$0…$9属性。要匹配圆括号字符,请使用“\( "或"\) "。 |
(?:pattern) | 匹配pattern但不获取匹配结果,也就是说这是一个非获取匹配,不进行存储供以后使用。这在使用或字符“(|) "来组合一个模式的各个部分是很有用。例如"industr(?:y|ies) "就是一个比"industry|industries "更简略的表达式。 |
(?=pattern) | 正向肯定预查,在任何匹配pattern的字符串开始处匹配查找字符串。这是一个非获取匹配,也就是说,该匹配不需要获取供以后使用。例如,“Windows(?=95|98|NT|2000) "能匹配"Windows2000 "中的"Windows ",但不能匹配"Windows3.1 "中的"Windows "。预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开始下一次匹配的搜索,而不是从包含预查的字符之后开始。 |
(?!pattern) | 正向否定预查,在任何不匹配pattern的字符串开始处匹配查找字符串。这是一个非获取匹配,也就是说,该匹配不需要获取供以后使用。例如“Windows(?!95|98|NT|2000) "能匹配"Windows3.1 "中的"Windows ",但不能匹配"Windows2000 "中的"Windows "。预查不消耗字符,也就是说,在一个匹配发生后,在最后一次匹配之后立即开始下一次匹配的搜索,而不是从包含预查的字符之后开始 |
(?<=pattern) | 反向肯定预查,与正向肯定预查类拟,只是方向相反。例如,“(?<=95|98|NT|2000)Windows "能匹配"2000Windows "中的"Windows ",但不能匹配"3.1Windows "中的"Windows "。 |
(?<!pattern) | 反向否定预查,与正向否定预查类拟,只是方向相反。例如“(?<!95|98|NT|2000)Windows "能匹配"3.1Windows "中的"Windows ",但不能匹配"2000Windows "中的"Windows "。 |
x|y | 匹配x或y。例如,“z|food "能匹配"z "或"food "。"(z|f)ood "则匹配"zood "或"food "。 |
[xyz] | 字符集合。匹配所包含的任意一个字符。例如,“[abc] "可以匹配"plain "中的"a "。 |
[^xyz] | 负值字符集合。匹配未包含的任意字符。例如,“[^abc] "可以匹配"plain "中的"p "。 |
[a-z] | 字符范围。匹配指定范围内的任意字符。例如,“[a-z] "可以匹配"a "到"z "范围内的任意小写字母字符。 |
[^a-z] | 负值字符范围。匹配任何不在指定范围内的任意字符。例如,“[^a-z] "可以匹配任何不在"a "到"z "范围内的任意字符。 |
\b | 匹配一个单词边界,也就是指单词和空格间的位置。例如,“er\b "可以匹配"never "中的"er ",但不能匹配"verb "中的"er "。 |
\B | 匹配非单词边界。“er\B "能匹配"verb "中的"er ",但不能匹配"never "中的"er "。 |
\cx | 匹配由x指明的控制字符。例如,\cM匹配一个Control-M或回车符。x的值必须为A-Z或a-z之一。否则,将c视为一个原义的“c "字符。 |
\d | 匹配一个数字字符。等价于[0-9]。 |
\D | 匹配一个非数字字符。等价于[^0-9]。 |
\f | 匹配一个换页符。等价于\x0c和\cL。 |
\n | 匹配一个换行符。等价于\x0a和\cJ。 |
\r | 匹配一个回车符。等价于\x0d和\cM。 |
\s | 匹配任何空白字符,包括空格、制表符、换页符等等。等价于[ \f\n\r\t\v]。 |
\S | 匹配任何非空白字符。等价于[^ \f\n\r\t\v]。 |
\t | 匹配一个制表符。等价于\x09和\cI。 |
\v | 匹配一个垂直制表符。等价于\x0b和\cK。 |
\w | 匹配包括下划线的任何单词字符。等价于“[A-Za-z0-9_] "。 |
\W | 匹配任何非单词字符。等价于“[^A-Za-z0-9_] "。 |
\xn | 匹配n,其中n为十六进制转义值。十六进制转义值必须为确定的两个数字长。例如,“\x41 "匹配"A "。"\x041 "则等价于"\x04&1 "。正则表达式中可以使用ASCII编码。. |
\num | 匹配num,其中num是一个正整数。对所获取的匹配的引用。例如,“(.)\1 "匹配两个连续的相同字符。 |
\n | 标识一个八进制转义值或一个向后引用。如果\n之前至少n个获取的子表达式,则n为向后引用。否则,如果n为八进制数字(0-7),则n为一个八进制转义值。 |
\nm | 标识一个八进制转义值或一个向后引用。如果\nm之前至少有nm个获得子表达式,则nm为向后引用。如果\nm之前至少有n个获取,则n为一个后跟文字m的向后引用。如果前面的条件都不满足,若n和m均为八进制数字(0-7),则\nm将匹配八进制转义值nm。 |
\nml | 如果n为八进制数字(0-3),且m和l均为八进制数字(0-7),则匹配八进制转义值nml。 |
\un | 匹配n,其中n是一个用四个十六进制数字表示的Unicode字符。例如,\u00A9匹配版权符号(©)。 |
用户名 | /^[a-z0-9_-]{3,16}$/ |
---|---|
密码 | /^[a-z0-9_-]{6,18}$/ |
密码2 | (?=^.{8,}$)(?=.*\d)(?=.*\W+)(?=.*[A-Z])(?=.*[a-z])(?!.*\n).*$ (由数字/大写字母/小写字母/标点符号组成,四种都必有,8位以上) |
十六进制值 | /^#?([a-f0-9]{6}|[a-f0-9]{3})$/ |
电子邮箱 | /^([a-z0-9_\.-]+)@([\da-z\.-]+)\.([a-z\.]{2,6})$/ /^[a-z\d]+(\.[a-z\d]+)*@([\da-z](-[\da-z])?)+(\.{1,2}[a-z]+)+$/或\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)* |
URL | /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/ 或 [a-zA-z]+://[^\s]* |
IP 地址 | /((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?)/ /^(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)$/ 或 ((2[0-4]\d|25[0-5]|[01]?\d\d?)\.){3}(2[0-4]\d|25[0-5]|[01]?\d\d?) |
HTML 标签 | /^<([a-z]+)([^<]+)*(?:>(.*)<\/\1>|\s+\/>)$/或<(.*)(.*)>.*<\/\1>|<(.*) \/> |
删除代码\\注释 | (?<!http:|\S)//.*$ |
匹配双字节字符(包括汉字在内) | [^\x00-\xff] |
汉字(字符) | [\u4e00-\u9fa5] |
Unicode编码中的汉字范围 | /^[\u2E80-\u9FFF]+$/ |
中文及全角标点符号(字符) | [\u3000-\u301e\ufe10-\ufe19\ufe30-\ufe44\ufe50-\ufe6b\uff01-\uffee] |
日期(年-月-日) | (\d{4}|\d{2})-((0?([1-9]))|(1[1|2]))-((0?[1-9])|([12]([1-9]))|(3[0|1])) |
日期(月/日/年) | ((0?[1-9]{1})|(1[1|2]))/(0?[1-9]|([12][1-9])|(3[0|1]))/(\d{4}|\d{2}) |
时间(小时:分钟, 24小时制) | ((1|0?)[0-9]|2[0-3]):([0-5][0-9]) |
中国大陆固定电话号码 | (\d{4}-|\d{3}-)?(\d{8}|\d{7}) |
中国大陆手机号码 | 1\d{10} |
中国大陆邮政编码 | [1-9]\d{5} |
中国大陆身份证号(15位或18位) | \d{15}(\d\d[0-9xX])? |
非负整数(正整数或零) | \d+ |
正整数 | [0-9]*[1-9][0-9]* |
负整数 | -[0-9]*[1-9][0-9]* |
整数 | -?\d+ |
小数 | (-?\d+)(\.\d+)? |
空白行 | \n\s*\r 或者 \n\n(editplus) 或者 ^[\s\S ]*\n |
QQ号码 | [1-9]\d{4,} |
不包含abc的单词 | \b((?!abc)\w)+\b |
匹配首尾空白字符 | ^\s*|\s*$ |
编辑常用 | 以下是针对特殊中文的一些替换(editplus) ^[0-9].*\n ^[^第].*\n ^[习题].*\n ^[\s\S ]*\n ^[0-9]*\. ^[\s\S ]*\n <p[^<>*]> href="javascript:if\(confirm\('(.*?)'\)\)window\.location='(.*?)'" <span style=".[^"]*rgb\(255,255,255\)">.[^<>]*</span> <DIV class=xs0>[\s\S]*?</DIV> |