From 160884bab5ca59f2aa58bdc148aa98e653eac1df Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Tue, 24 Jul 2018 13:52:41 -0400 Subject: [PATCH] core: fix typos in union_find MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/core/collection/union_find.nit | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/core/collection/union_find.nit b/lib/core/collection/union_find.nit index b44b7f9..80c5005 100644 --- a/lib/core/collection/union_find.nit +++ b/lib/core/collection/union_find.nit @@ -13,7 +13,8 @@ module union_find import hash_collection -# Data structure to keeps track of elements partitioned into disjoint subsets +# Data structure to keep track of elements partitioned into disjoint subsets +# # var s = new DisjointSet[Int] # s.add(1) # s.add(2) @@ -21,15 +22,15 @@ import hash_collection # s.union(1,2) # assert s.in_same_subset(1,2) # -# `in_same_subset` is transitive, reflexive and symetric +# `in_same_subset` is transitive, reflexive and symmetric # # s.add(3) # assert not s.in_same_subset(1,3) # s.union(3,2) # assert s.in_same_subset(1,3) # -# Unkike theorical Disjoint-set data structures, the underling implementation is opaque -# that makes the traditionnal `find` method unavailable for clients. +# Unlike theoretical Disjoint-set data structures, the underling implementation is opaque +# making the traditional `find` method unavailable for clients. # The methods `in_same_subset`, `to_partitions`, and their variations are offered instead. class DisjointSet[E] super SimpleCollection[E] @@ -170,7 +171,7 @@ class DisjointSet[E] return to_subpartition(self) end - # Construct a partitionning on `es`, a subset of elements + # Construct a partitioning on `es`, a subset of elements # # var s = new DisjointSet[Int] # s.add_all([1,2,3,4,5,6]) @@ -235,7 +236,7 @@ private class DisjointSetNode # If parent == self then the node is a root var parent: DisjointSetNode = self - # The rank to no desequilibrate the structure. + # The rank to keep the structure balanced. # The term rank is used instead of depth since # path compression is used, see `DisjointSet::nfind` var rank = 0 -- 1.7.9.5