title: Union-find data structure
body: <p>For many problems I see the solution recommended is to use a union-find data structure. I tried to read about it and think about how it is implemented (using C++). My current understanding is that it is nothing but a list of sets. So to find which set an element belongs we require <code>n*log n</code> operations. And when we have to perform union, then we have to find the two sets which needs to be merged and do a <code>set_union</code> on them. This doesn't look terribly efficient to me. Is my understanding of this data structure correct or am I missing something?</p>