Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Troublesome cs problem using union find This assignment asks you to write a program in Java (or another language you choose) to find disjoint groups
Troublesome cs problem using union find This assignment asks you to write a program in Java (or another language you choose) to find disjoint groups in a set of data. Here is the story: Tomorrow is Jack & Lucy's wedding day. They have a lot of friends who will attend their wedding. Afterwards, they will have dinner together, so Jack & Lucy want to know minimum number of tables they need to setup. And you must consider that not all the friends know each other, and friends do not want to sit with strangers One rule for this is that if I tell you A knows B, and B knows C, that means A, B, C know each other (i.e., "X knows Y" is a transitive relationship), so they can sit on the same table. For example, if l tell you A knows B, B knows C, and D knows E, so A, B, C can sit on one table, and D, E must sit on another table. Therefore, this instance needs at least 2 tables. Input: Your program reads inputs from a file. The file starts with a line of two integers N and M (1
Troublesome cs problem using union find
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started