walkccc / CLRS

📚 Solutions to Introduction to Algorithms Third Edition
https://walkccc.me/CLRS
MIT License
4.69k stars 1.26k forks source link

21.3-1 solution incorrect and incomplete #492

Open rb05751 opened 9 months ago

rb05751 commented 9 months ago

I noticed that for the solution to problem 21.3-1, only the resulting data structure was provided but the data structure doesn't show the path compression done and it also has 1 as the representative node for the set. It doesn't provide the answers returned by the 2 find set calls either.

The representative node should be 16 for the entire set and the two find-set operations should be included in modifying the tree via path compression.