Analysis of union by size
-
Lecture Data Structures: Lesson 36 provide students with knowledge about union by size; maintain sizes (number of nodes) of all trees, and during union; make smaller tree the subtree of the larger one; implementation: for each root node i, instead of setting parent[i] to -1, set it to -k if tree rooted at i has k nodes;...
24p hanthienngao 15-04-2022 19 2 Download