stanford algorithms course: union find and percolation