exercises - for union find