commit 30110bf90d08a5a6c75e0c9e663a90e0b1af6761 Author: mmlhbjk Date: Fri Oct 11 00:59:20 2024 +0800 博客 https://blog.lenyiin.com/union-find/ 的代码仓库 diff --git a/Linux/Makefile b/Linux/Makefile new file mode 100644 index 0000000..be8ac5b --- /dev/null +++ b/Linux/Makefile @@ -0,0 +1,5 @@ +unionfindset:UnionFindSet.cc + g++ -o $@ $^ +.PHONY:clean +clean: + rm -f unionfindset \ No newline at end of file diff --git a/Linux/UnionFindSet.cc b/Linux/UnionFindSet.cc new file mode 100644 index 0000000..1bf2bab --- /dev/null +++ b/Linux/UnionFindSet.cc @@ -0,0 +1,42 @@ +#include "UnionFindSet.hpp" + +void TestUnionFindSet_1() +{ + Lenyiin::UnionFindSet ufs(10); + ufs.Union(8, 9); + ufs.Union(7, 8); + ufs.Union(6, 7); + ufs.Union(5, 6); + ufs.Union(4, 5); + ufs.Union(3, 4); + ufs.Union(2, 3); + ufs.Union(1, 2); + ufs.Union(0, 1); + ufs.Print(); +} + +void TestUnionFindSet_2() +{ + Lenyiin::UnionFindSet ufs(10); + ufs.Union(0, 1); + ufs.Union(2, 3); + ufs.Union(4, 5); + ufs.Union(6, 7); + ufs.Union(8, 9); + ufs.Union(1, 3); + ufs.Union(5, 7); + ufs.Union(0, 2); + ufs.Union(4, 6); + ufs.Union(0, 4); + + ufs.FindRoot(0); + ufs.Print(); +} + +int main() +{ + TestUnionFindSet_1(); + TestUnionFindSet_2(); + + return 0; +} \ No newline at end of file diff --git a/Linux/UnionFindSet.hpp b/Linux/UnionFindSet.hpp new file mode 100644 index 0000000..dae2da6 --- /dev/null +++ b/Linux/UnionFindSet.hpp @@ -0,0 +1,120 @@ +#pragma once + +#include +#include +#include + +namespace Lenyiin +{ + class UnionFindSet + { + public: + // 初始化: 为每个元素单独分配一个集合, 初始时每个集合大小为 1, 用 -1 表示 + UnionFindSet(int n) + : _v(n, -1) // 初始化所有元素都为根节点, 且集合大小为1 + { + } + + // 查找操作: 找到元素 x 所属集合的根节点, 并使用路径压缩优化 + int FindRoot(int x) + { + int root = x; + // 查找根节点, 沿着父节点链向上寻找 + while (_v[root] >= 0) + { + root = _v[root]; + } + + // 路径压缩: 将路径上所有节点直接挂在根节点下 + while (x != root) + { + int parent = _v[x]; // 保存当前节点的父节点 + _v[x] = root; // 将当前节点直接连接到根节点 + x = parent; // 继续处理父节点 + } + + return root; // 返回根节点 + } + + // 合并两个集合: 使用按秩合并优化 + bool Union(int x1, int x2) + { + int root1 = FindRoot(x1); + int root2 = FindRoot(x2); + + // 如果本身就在一个集合里, 则无需合并 + if (root1 == root2) + { + return false; + } + + // 按秩合并: 始终将较小的集合挂到较大的集合上 + if (_v[root1] < _v[root2]) // root1 集合规模较大(负值越小, 集合越大) + { + _v[root1] += _v[root2]; // 增加 root1 集合的大小 + _v[root2] = root1; // root2 挂到 root1 上 + } + else + { + _v[root2] += _v[root1]; // 增加 root2 集合的大小 + _v[root1] = root2; // root1 挂到 root2 上 + } + + return true; // 合并成功 + } + + // 判断两个元素是否在同一个集合中 + bool InSet(int x1, int x2) + { + return FindRoot(x2) == FindRoot(x2); + } + + // 统计当前集合的个数 + size_t SetSize() + { + size_t count = 0; + for (auto e : _v) + { + if (e < 0) // 只有根节点存储负值, 表示集合的大小 + { + ++count; + } + } + return count; + } + + // 打印当前并查集的结构 (用于调试) + void Print() const + { + for (int i = 0; i < _v.size(); ++i) + { + printf("v[%d] == %d\n", i, _v[i]); + } + printf("\n"); + } + + private: + std::vector _v; // 存储每个元素的父节点或集合大小 + }; +} + +// namespace Lenyiin +//{ +// template +// class UnionFindSet +// { +// public: +// UnionFindSet(const T* a, size_t n) +// { +// for (size_t i = 0; i < n; ++i) +// { +// _v.push_back(a[i]); +// _indexmap[a[i]] = i; +// } +// } +// +// private: +// vector _v; // 人找编号 +// map _indexmap; // 编号找人 +// }; +// } \ No newline at end of file diff --git a/Linux/unionfindset b/Linux/unionfindset new file mode 100644 index 0000000..21bfd4e Binary files /dev/null and b/Linux/unionfindset differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/CodeChunks.db b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/CodeChunks.db new file mode 100644 index 0000000..9fec419 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/CodeChunks.db differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db new file mode 100644 index 0000000..527188c Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db-shm b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db-shm new file mode 100644 index 0000000..13101e9 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db-shm differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db-wal b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db-wal new file mode 100644 index 0000000..4873136 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/CopilotIndices/0.2.1653.9816/SemanticSymbols.db-wal differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/06054c4e-f93a-44e5-9cb9-b8afdd64619e.vsidx b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/06054c4e-f93a-44e5-9cb9-b8afdd64619e.vsidx new file mode 100644 index 0000000..fb09f61 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/06054c4e-f93a-44e5-9cb9-b8afdd64619e.vsidx differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/1b767140-ea8a-4cfc-8f31-0ef78a9c0ad3.vsidx b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/1b767140-ea8a-4cfc-8f31-0ef78a9c0ad3.vsidx new file mode 100644 index 0000000..5756705 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/1b767140-ea8a-4cfc-8f31-0ef78a9c0ad3.vsidx differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/3b52e03f-d694-4c6c-b341-fabfcfea3826.vsidx b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/3b52e03f-d694-4c6c-b341-fabfcfea3826.vsidx new file mode 100644 index 0000000..46ae3f8 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/FileContentIndex/3b52e03f-d694-4c6c-b341-fabfcfea3826.vsidx differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/.suo b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/.suo new file mode 100644 index 0000000..eaf8347 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/.suo differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/Browse.VC.db b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/Browse.VC.db new file mode 100644 index 0000000..e5f8a67 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/Browse.VC.db differ diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/DocumentLayout.backup.json b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/DocumentLayout.backup.json new file mode 100644 index 0000000..e585a15 --- /dev/null +++ b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/DocumentLayout.backup.json @@ -0,0 +1,66 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|solutionrelative:UnionFindSet.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|solutionrelative:UnionFindSet.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 267, + "SelectedChildIndex": 3, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "UnionFindSet.hpp", + "DocumentMoniker": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.hpp", + "RelativeDocumentMoniker": "UnionFindSet.hpp", + "ToolTip": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.hpp*", + "RelativeToolTip": "UnionFindSet.hpp*", + "ViewState": "AgIAAFEAAAAAAAAAAAAowG0AAAAGAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-10-10T16:56:48.361Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "UnionFindSet.cpp", + "DocumentMoniker": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.cpp", + "RelativeDocumentMoniker": "UnionFindSet.cpp", + "ToolTip": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.cpp*", + "RelativeToolTip": "UnionFindSet.cpp*", + "ViewState": "AgIAAAAAAAAAAAAAAAAowCkAAAABAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-10-10T16:56:29.902Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/DocumentLayout.json b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/DocumentLayout.json new file mode 100644 index 0000000..810c49e --- /dev/null +++ b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/DocumentLayout.json @@ -0,0 +1,66 @@ +{ + "Version": 1, + "WorkspaceRootPath": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\", + "Documents": [ + { + "AbsoluteMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|solutionrelative:UnionFindSet.hpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + }, + { + "AbsoluteMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{E780F4E3-14DF-4F84-A802-08BD1E4086CC}|Windows_UnionFindSet.vcxproj|solutionrelative:UnionFindSet.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + } + ], + "DocumentGroupContainers": [ + { + "Orientation": 0, + "VerticalTabListWidth": 256, + "DocumentGroups": [ + { + "DockedWidth": 267, + "SelectedChildIndex": 3, + "Children": [ + { + "$type": "Bookmark", + "Name": "ST:128:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:129:0:{116d2292-e37d-41cd-a077-ebacac4c8cc4}" + }, + { + "$type": "Bookmark", + "Name": "ST:128:0:{1fc202d4-d401-403c-9834-5b218574bb67}" + }, + { + "$type": "Document", + "DocumentIndex": 0, + "Title": "UnionFindSet.hpp", + "DocumentMoniker": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.hpp", + "RelativeDocumentMoniker": "UnionFindSet.hpp", + "ToolTip": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.hpp", + "RelativeToolTip": "UnionFindSet.hpp", + "ViewState": "AgIAAFEAAAAAAAAAAAAowF4AAAAAAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", + "WhenOpened": "2024-10-10T16:56:48.361Z", + "EditorCaption": "" + }, + { + "$type": "Document", + "DocumentIndex": 1, + "Title": "UnionFindSet.cpp", + "DocumentMoniker": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.cpp", + "RelativeDocumentMoniker": "UnionFindSet.cpp", + "ToolTip": "E:\\Git \u4ED3\u5E93\\\u516C\u5F00\u4ED3\u5E93\\12_UnionFind\\Windows_UnionFindSet\\UnionFindSet.cpp", + "RelativeToolTip": "UnionFindSet.cpp", + "ViewState": "AgIAAAAAAAAAAAAAAAAowCkAAAABAAAAAAAAAA==", + "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", + "WhenOpened": "2024-10-10T16:56:29.902Z", + "EditorCaption": "" + } + ] + } + ] + } + ] +} \ No newline at end of file diff --git a/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/ipch/AutoPCH/2582c14ecb401fa5/UNIONFINDSET.ipch b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/ipch/AutoPCH/2582c14ecb401fa5/UNIONFINDSET.ipch new file mode 100644 index 0000000..013f212 Binary files /dev/null and b/Windows_UnionFindSet/.vs/Windows_UnionFindSet/v17/ipch/AutoPCH/2582c14ecb401fa5/UNIONFINDSET.ipch differ diff --git a/Windows_UnionFindSet/UnionFindSet.cpp b/Windows_UnionFindSet/UnionFindSet.cpp new file mode 100644 index 0000000..1bf2bab --- /dev/null +++ b/Windows_UnionFindSet/UnionFindSet.cpp @@ -0,0 +1,42 @@ +#include "UnionFindSet.hpp" + +void TestUnionFindSet_1() +{ + Lenyiin::UnionFindSet ufs(10); + ufs.Union(8, 9); + ufs.Union(7, 8); + ufs.Union(6, 7); + ufs.Union(5, 6); + ufs.Union(4, 5); + ufs.Union(3, 4); + ufs.Union(2, 3); + ufs.Union(1, 2); + ufs.Union(0, 1); + ufs.Print(); +} + +void TestUnionFindSet_2() +{ + Lenyiin::UnionFindSet ufs(10); + ufs.Union(0, 1); + ufs.Union(2, 3); + ufs.Union(4, 5); + ufs.Union(6, 7); + ufs.Union(8, 9); + ufs.Union(1, 3); + ufs.Union(5, 7); + ufs.Union(0, 2); + ufs.Union(4, 6); + ufs.Union(0, 4); + + ufs.FindRoot(0); + ufs.Print(); +} + +int main() +{ + TestUnionFindSet_1(); + TestUnionFindSet_2(); + + return 0; +} \ No newline at end of file diff --git a/Windows_UnionFindSet/UnionFindSet.hpp b/Windows_UnionFindSet/UnionFindSet.hpp new file mode 100644 index 0000000..36d78eb --- /dev/null +++ b/Windows_UnionFindSet/UnionFindSet.hpp @@ -0,0 +1,120 @@ +#pragma once + +#include +#include +#include + +namespace Lenyiin +{ + class UnionFindSet + { + public: + // ʼ: ΪÿԪصһ, ʼʱÿϴСΪ 1, -1 ʾ + UnionFindSet(int n) + : _v(n, -1) // ʼԪضΪڵ, ҼϴСΪ1 + { + } + + // Ҳ: ҵԪ x ϵĸڵ, ʹ·ѹŻ + int FindRoot(int x) + { + int root = x; + // Ҹڵ, ŸڵѰ + while (_v[root] >= 0) + { + root = _v[root]; + } + + // ·ѹ: ·нڵֱӹڸڵ + while (x != root) + { + int parent = _v[x]; // 浱ǰڵĸڵ + _v[x] = root; // ǰڵֱӵڵ + x = parent; // ڵ + } + + return root; // ظڵ + } + + // ϲ: ʹðȺϲŻ + bool Union(int x1, int x2) + { + int root1 = FindRoot(x1); + int root2 = FindRoot(x2); + + // һ, ϲ + if (root1 == root2) + { + return false; + } + + // Ⱥϲ: ʼսСļϹҵϴļ + if (_v[root1] < _v[root2]) // root1 Ϲģϴ󣨸ֵԽС, Խ + { + _v[root1] += _v[root2]; // root1 ϵĴС + _v[root2] = root1; // root2 ҵ root1 + } + else + { + _v[root2] += _v[root1]; // root2 ϵĴС + _v[root1] = root2; // root1 ҵ root2 + } + + return true; // ϲɹ + } + + // жԪǷͬһ + bool InSet(int x1, int x2) + { + return FindRoot(x2) == FindRoot(x2); + } + + // ͳƵǰϵĸ + size_t SetSize() + { + size_t count = 0; + for (auto e : _v) + { + if (e < 0) // ֻиڵ洢ֵ, ʾϵĴС + { + ++count; + } + } + return count; + } + + // ӡǰ鼯Ľṹ (ڵ) + void Print() const + { + for (int i = 0; i < _v.size(); ++i) + { + printf("v[%d] == %d\n", i, _v[i]); + } + printf("\n"); + } + + private: + std::vector _v; // 洢ÿԪصĸڵ򼯺ϴС + }; +} + +// namespace Lenyiin +//{ +// template +// class UnionFindSet +// { +// public: +// UnionFindSet(const T* a, size_t n) +// { +// for (size_t i = 0; i < n; ++i) +// { +// _v.push_back(a[i]); +// _indexmap[a[i]] = i; +// } +// } +// +// private: +// vector _v; // ұ +// map _indexmap; // +// }; +// } \ No newline at end of file diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/UnionFindSet.obj b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/UnionFindSet.obj new file mode 100644 index 0000000..24b5d58 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/UnionFindSet.obj differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.command.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.command.1.tlog new file mode 100644 index 0000000..ab55201 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.command.1.tlog differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.read.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.read.1.tlog new file mode 100644 index 0000000..7efae15 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.read.1.tlog differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.write.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.write.1.tlog new file mode 100644 index 0000000..0b349ea Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/CL.write.1.tlog differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/Cl.items.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/Cl.items.tlog new file mode 100644 index 0000000..8f3c1be --- /dev/null +++ b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/Cl.items.tlog @@ -0,0 +1 @@ +E:\Git 仓库\公开仓库\12_UnionFind\Windows_UnionFindSet\UnionFindSet.cpp;E:\Git 仓库\公开仓库\12_UnionFind\Windows_UnionFindSet\Windows_.e780f4e3\x64\Debug\UnionFindSet.obj diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/Windows_UnionFindSet.lastbuildstate b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/Windows_UnionFindSet.lastbuildstate new file mode 100644 index 0000000..ee1b862 --- /dev/null +++ b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/Windows_UnionFindSet.lastbuildstate @@ -0,0 +1,2 @@ +PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.41.34120:TargetPlatformVersion=10.0.22000.0: +Debug|x64|E:\Git 仓库\公开仓库\12_UnionFind\Windows_UnionFindSet\| diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.command.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.command.1.tlog new file mode 100644 index 0000000..422d7be Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.command.1.tlog differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.read.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.read.1.tlog new file mode 100644 index 0000000..e71d072 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.read.1.tlog differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.secondary.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.secondary.1.tlog new file mode 100644 index 0000000..df602d1 --- /dev/null +++ b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.secondary.1.tlog @@ -0,0 +1,2 @@ +^E:\GIT 仓库\公开仓库\12_UNIONFIND\WINDOWS_UNIONFINDSET\WINDOWS_.E780F4E3\X64\DEBUG\UNIONFINDSET.OBJ +E:\Git 仓库\公开仓库\12_UnionFind\Windows_UnionFindSet\Windows_.e780f4e3\x64\Debug\Windows_UnionFindSet.ilk diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.write.1.tlog b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.write.1.tlog new file mode 100644 index 0000000..579adc4 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_.e780f4e3.tlog/link.write.1.tlog differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.exe.recipe b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.exe.recipe new file mode 100644 index 0000000..b956aee --- /dev/null +++ b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.exe.recipe @@ -0,0 +1,11 @@ + + + + + E:\Git 仓库\公开仓库\12_UnionFind\Windows_UnionFindSet\x64\Debug\Windows_UnionFindSet.exe + + + + + + \ No newline at end of file diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.ilk b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.ilk new file mode 100644 index 0000000..3218b7f Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.ilk differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.log b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.log new file mode 100644 index 0000000..998b386 --- /dev/null +++ b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/Windows_UnionFindSet.log @@ -0,0 +1,2 @@ + UnionFindSet.cpp + Windows_UnionFindSet.vcxproj -> E:\Git 仓库\公开仓库\12_UnionFind\Windows_UnionFindSet\x64\Debug\Windows_UnionFindSet.exe diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/vc143.idb b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/vc143.idb new file mode 100644 index 0000000..c58f744 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/vc143.idb differ diff --git a/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/vc143.pdb b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/vc143.pdb new file mode 100644 index 0000000..20b7f48 Binary files /dev/null and b/Windows_UnionFindSet/Windows_.e780f4e3/x64/Debug/vc143.pdb differ diff --git a/Windows_UnionFindSet/Windows_UnionFindSet.sln b/Windows_UnionFindSet/Windows_UnionFindSet.sln new file mode 100644 index 0000000..2981401 --- /dev/null +++ b/Windows_UnionFindSet/Windows_UnionFindSet.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.11.35312.102 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Windows_UnionFindSet", "Windows_UnionFindSet.vcxproj", "{E780F4E3-14DF-4F84-A802-08BD1E4086CC}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Debug|x64.ActiveCfg = Debug|x64 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Debug|x64.Build.0 = Debug|x64 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Debug|x86.ActiveCfg = Debug|Win32 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Debug|x86.Build.0 = Debug|Win32 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Release|x64.ActiveCfg = Release|x64 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Release|x64.Build.0 = Release|x64 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Release|x86.ActiveCfg = Release|Win32 + {E780F4E3-14DF-4F84-A802-08BD1E4086CC}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {45BCDB8D-5567-4827-9713-EDD43FA81124} + EndGlobalSection +EndGlobal diff --git a/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj b/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj new file mode 100644 index 0000000..5e078f6 --- /dev/null +++ b/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj @@ -0,0 +1,138 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 17.0 + Win32Proj + {e780f4e3-14df-4f84-a802-08bd1e4086cc} + WindowsUnionFindSet + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + + + + \ No newline at end of file diff --git a/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj.filters b/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj.filters new file mode 100644 index 0000000..09280d4 --- /dev/null +++ b/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj.filters @@ -0,0 +1,27 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + 源文件 + + + + + 头文件 + + + \ No newline at end of file diff --git a/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj.user b/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj.user new file mode 100644 index 0000000..88a5509 --- /dev/null +++ b/Windows_UnionFindSet/Windows_UnionFindSet.vcxproj.user @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Windows_UnionFindSet/x64/Debug/Windows_UnionFindSet.exe b/Windows_UnionFindSet/x64/Debug/Windows_UnionFindSet.exe new file mode 100644 index 0000000..3486846 Binary files /dev/null and b/Windows_UnionFindSet/x64/Debug/Windows_UnionFindSet.exe differ diff --git a/Windows_UnionFindSet/x64/Debug/Windows_UnionFindSet.pdb b/Windows_UnionFindSet/x64/Debug/Windows_UnionFindSet.pdb new file mode 100644 index 0000000..ab821cb Binary files /dev/null and b/Windows_UnionFindSet/x64/Debug/Windows_UnionFindSet.pdb differ