diff --git a/.vscode/c_cpp_properties.json b/DataStructure/.vscode/c_cpp_properties.json similarity index 100% rename from .vscode/c_cpp_properties.json rename to DataStructure/.vscode/c_cpp_properties.json diff --git a/.vscode/launch.json b/DataStructure/.vscode/launch.json similarity index 100% rename from .vscode/launch.json rename to DataStructure/.vscode/launch.json diff --git a/.vscode/settings.json b/DataStructure/.vscode/settings.json similarity index 100% rename from .vscode/settings.json rename to DataStructure/.vscode/settings.json diff --git a/.vscode/tasks.json b/DataStructure/.vscode/tasks.json similarity index 100% rename from .vscode/tasks.json rename to DataStructure/.vscode/tasks.json diff --git a/DataStructure/Code.7z b/DataStructure/Code.7z new file mode 100644 index 0000000..b65e3ec Binary files /dev/null and b/DataStructure/Code.7z differ diff --git a/DataStructure/Code/ex04/ex4.cpp b/DataStructure/Code/ex04/ex4.cpp index cf808c6..81fc186 100644 --- a/DataStructure/Code/ex04/ex4.cpp +++ b/DataStructure/Code/ex04/ex4.cpp @@ -12,41 +12,41 @@ int main() srand(time(NULL)); int len; - printf("输入秩\n"); + printf("杈撳叆绉‐n"); scanf("%d", &len); - printf("生成数组\n"); + printf("鐢熸垚鏁扮粍\n"); // scanf("%d", &len); Vec a(len, 1); Vec b(len, 2); Vec a_(&a); Vec b_(&b); - printf("A归并排序...\n"); + printf("A褰掑苟鎺掑簭...\n"); astart_t = clock(); a.mergeSort(0, a.getused()); aend_t = clock(); - printf("A冒泡排序...\n"); + printf("A鍐掓场鎺掑簭...\n"); a_start_t = clock(); a_.bubbleSort(); a_end_t = clock(); - printf("B归并排序...\n"); + printf("B褰掑苟鎺掑簭...\n"); bstart_t = clock(); b.mergeSort(0, a.getused()); bend_t = clock(); - printf("B冒泡排序...\n"); + printf("B鍐掓场鎺掑簭...\n"); b_start_t = clock(); b_.bubbleSort(); b_end_t = clock(); - printf("A归并运算时间: %.4f 秒\n", ((double)(aend_t - astart_t) / CLOCKS_PER_SEC)); - printf("A冒泡运算时间: %.4f 秒\n", ((double)(a_end_t - a_start_t) / CLOCKS_PER_SEC)); - printf("B归并运算时间: %.4f 秒\n", ((double)(bend_t - bstart_t) / CLOCKS_PER_SEC)); - printf("B冒泡运算时间: %.4f 秒\n", ((double)(b_end_t - b_start_t) / CLOCKS_PER_SEC)); + printf("A褰掑苟杩愮畻鏃堕棿: %.4f 绉抃n", ((double)(aend_t - astart_t) / CLOCKS_PER_SEC)); + printf("A鍐掓场杩愮畻鏃堕棿: %.4f 绉抃n", ((double)(a_end_t - a_start_t) / CLOCKS_PER_SEC)); + printf("B褰掑苟杩愮畻鏃堕棿: %.4f 绉抃n", ((double)(bend_t - bstart_t) / CLOCKS_PER_SEC)); + printf("B鍐掓场杩愮畻鏃堕棿: %.4f 绉抃n", ((double)(b_end_t - b_start_t) / CLOCKS_PER_SEC)); - printf("输出归并样本A:\n[0-19]\n"); + printf("杈撳嚭褰掑苟鏍锋湰A:\n[0-19]\n"); for (int i = 0; i <= 19; i++) printf("%d\n", a.get(i)); printf("[50000-50019]\n"); @@ -56,7 +56,7 @@ int main() for (int i = 99980; i <= 99999; i++) printf("%d\n", a.get(i)); - printf("输出冒泡样本A:\n[0-19]\n"); + printf("杈撳嚭鍐掓场鏍锋湰A:\n[0-19]\n"); for (int i = 0; i <= 19; i++) printf("%d\n", a_.get(i)); printf("[50000-50019]\n"); @@ -66,7 +66,7 @@ int main() for (int i = 99980; i <= 99999; i++) printf("%d\n", a_.get(i)); - printf("输出归并样本B:\n[0-19]\n"); + printf("杈撳嚭褰掑苟鏍锋湰B:\n[0-19]\n"); for (int i = 0; i <= 19; i++) printf("%d\n", b.get(i)); printf("[50000-50019]\n"); @@ -76,7 +76,7 @@ int main() for (int i = 99980; i <= 99999; i++) printf("%d\n", b.get(i)); - printf("输出冒泡样本B:\n[0-19]\n"); + printf("杈撳嚭鍐掓场鏍锋湰B:\n[0-19]\n"); for (int i = 0; i <= 19; i++) printf("%d\n", b_.get(i)); printf("[50000-50019]\n"); diff --git a/DataStructure/Code/ex04/vec.cpp b/DataStructure/Code/ex04/vec.cpp index 2ea93f1..8f2ef4e 100644 --- a/DataStructure/Code/ex04/vec.cpp +++ b/DataStructure/Code/ex04/vec.cpp @@ -66,7 +66,7 @@ void Vec::shrink() delete[] _v; _v = p; } -//位置 数值 +//浣嶇疆 鏁板 int Vec::insert(int locate, int value) { if (locate == _used + 1) @@ -91,7 +91,7 @@ int Vec::insert(int locate, int value) return 0; } -//位置 删除个数 +//浣嶇疆 鍒犻櫎涓暟 int Vec::remove(int locate, int value) { @@ -108,7 +108,7 @@ int Vec::remove(int locate, int value) return value; } -//删除某一元素 +//鍒犻櫎鏌愪竴鍏冪礌 int Vec::remove_sorted(int value) { int j, i; diff --git a/DataStructure/Code/ex06/vec.cpp b/DataStructure/Code/ex06/vec.cpp index 1826962..91240e4 100644 --- a/DataStructure/Code/ex06/vec.cpp +++ b/DataStructure/Code/ex06/vec.cpp @@ -68,7 +68,7 @@ void Vec::shrink() delete[] _v; _v = p; } -//位置 数值 +//浣嶇疆 鏁板 int Vec::insert(int locate, int value) { if (locate == _used + 1) @@ -93,7 +93,7 @@ int Vec::insert(int locate, int value) return 0; } -//位置 删除个数 +//浣嶇疆 鍒犻櫎涓暟 int Vec::remove(int locate, int value) { @@ -110,7 +110,7 @@ int Vec::remove(int locate, int value) return value; } -//删除某一元素 +//鍒犻櫎鏌愪竴鍏冪礌 int Vec::remove_sorted(int value) { int j, i; diff --git a/DataStructure/README.md b/DataStructure/README.md new file mode 100644 index 0000000..b118dfe --- /dev/null +++ b/DataStructure/README.md @@ -0,0 +1,4 @@ +# 鏁版嵁缁撴瀯涓庣畻娉曡璁 璇剧▼浣滀笟 + +浣跨敤`gcc/clang`缂栬瘧锛岄儴鍒嗛厤缃枃浠跺彲瑙乕姝ゅ](https://irr.ink/2021/1XJKHTE/)銆 + diff --git a/workspace.code-workspace b/DataStructure/workspace.code-workspace similarity index 95% rename from workspace.code-workspace rename to DataStructure/workspace.code-workspace index 8cd4668..3a7c375 100644 --- a/workspace.code-workspace +++ b/DataStructure/workspace.code-workspace @@ -47,6 +47,7 @@ "typeinfo": "cpp", "ctime": "cpp", "iomanip": "cpp" - } + }, + "commentTranslate.hover.enabled": true } } \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100644 index 54c43b4..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -# 鏁版嵁缁撴瀯涓庣畻娉曡璁 璇剧▼浣滀笟