0
$\begingroup$

There is group of nodes. There are three type of nodes:

leader node . follower node - connected to one or more leader directly or indirectly. vagrant node - no connected to any leader directly or indirectly. We can dynamically connect any node to any other node .

link(node1, node2)

unlink(node1, node2) After random link and unlink operations

listNotConnected() should return list of vagrant node or unconnected nodes .

How to find list of nodes which are not connected to leader ? How to find it in real time ?

$\endgroup$
  • 1
    $\begingroup$ What do you think? Have you tried solving this on your own? We're not here to do your homework. $\endgroup$ – Yuval Filmus Mar 18 '17 at 8:22
  • $\begingroup$ What approaches have you considered so far? Where did you get stuck? We're happy to help you understand the concepts but just solving exercises for you is unlikely to achieve that. You might find this page helpful in improving your question. $\endgroup$ – D.W. Mar 18 '17 at 16:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.