Two people are Connected if they partnered directly, and Related if a chain of partnerships links them but they never partnered. Answer both in constant time.
Two people are Connected if they partnered directly, and Related if a chain of partnerships links them but they never partnered. Answer both in constant time.
Opens with the full question.