added two implementation of union find