You are not logged in. Please login at to post your questions!


connecting islands

can anyone please tell me which theorem is to be applied in connecting islands??

asked 05 Feb '15, 23:29

vip_code's gravatar image

accept rate: 0%

The question is basically asking if two vertices belong to the same connected component( edges are added dynamically here though).

Union-Find Disjoint data structure can be used to solve this problem. For each edge to be added between x any y, take the Union of set(x) and set(y) .

For checking if vertices x and y are connected or not, see if they both belong to the same set.


answered 05 Feb '15, 23:50

ironmandhruv's gravatar image

accept rate: 20%

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 05 Feb '15, 23:29

question was seen: 513 times

last updated: 05 Feb '15, 23:50

Related questions