An O(1) (worst case for both union and find) algorithm for the union-find problem
The main.c file just uses the algorithm, and does all the memory management, so it is a bit bulky since this is written in C. To see the actual algorithm, look in the DataTypes.c and DataTypes.h files.
I came up with this while I was at work, so I wrote it down on a piece of cardboard.. Here's that plan if you can make any of it out.