summaryrefslogtreecommitdiffstats
path: root/Documentation/core-api
diff options
context:
space:
mode:
authorXavier <xavier_qy@163.com>2024-08-02 05:33:46 +0200
committerTejun Heo <tj@kernel.org>2024-08-02 20:58:16 +0200
commit563ea1f5f85171b68f9075f5c3c22c4b521f1b5e (patch)
tree9807a18bfb5605d8be35d03459f64e725f758868 /Documentation/core-api
parentcgroup: Show # of subsystem CSSes in cgroup.stat (diff)
downloadlinux-563ea1f5f85171b68f9075f5c3c22c4b521f1b5e.tar.xz
linux-563ea1f5f85171b68f9075f5c3c22c4b521f1b5e.zip
Documentation: Fix the compilation errors in union_find.rst
Fix the compilation errors and warnings caused by merging Documentation/core-api/union_find.rst and Documentation/translations/zh_CN/core-api/union_find.rst. Signed-off-by: Xavier <xavier_qy@163.com> Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'Documentation/core-api')
-rw-r--r--Documentation/core-api/index.rst1
-rw-r--r--Documentation/core-api/union_find.rst6
2 files changed, 6 insertions, 1 deletions
diff --git a/Documentation/core-api/index.rst b/Documentation/core-api/index.rst
index f147854700e4..e18a2ffe0787 100644
--- a/Documentation/core-api/index.rst
+++ b/Documentation/core-api/index.rst
@@ -49,6 +49,7 @@ Library functionality that is used throughout the kernel.
wrappers/atomic_t
wrappers/atomic_bitops
floating-point
+ union_find
Low level entry and exit
========================
diff --git a/Documentation/core-api/union_find.rst b/Documentation/core-api/union_find.rst
index 2bf0290c9184..6df8b94fdb5a 100644
--- a/Documentation/core-api/union_find.rst
+++ b/Documentation/core-api/union_find.rst
@@ -16,9 +16,11 @@ of disjoint sets. The primary operations supported by union-find are:
Initialization: Resetting each element as an individual set, with
each set's initial parent node pointing to itself.
+
Find: Determine which set a particular element belongs to, usually by
returning a “representative element” of that set. This operation
is used to check if two elements are in the same set.
+
Union: Merge two sets into one.
As a data structure used to maintain sets (groups), union-find is commonly
@@ -63,7 +65,7 @@ operation, the tree with the smaller rank is attached under the tree with the
larger rank to maintain balance.
Initializing union-find
---------------------
+-----------------------
You can complete the initialization using either static or initialization
interface. Initialize the parent pointer to point to itself and set the rank
@@ -71,7 +73,9 @@ to 0.
Example::
struct uf_node my_node = UF_INIT_NODE(my_node);
+
or
+
uf_node_init(&my_node);
Find the Root Node of union-find