In a class room everyone is very friendly and has bonded with others in a short span of time. During the exams, students will sit along with their friends and will write the exams, which actually resulted in the finding that only a few members in the batch are good at studies and others are not. After getting several complaints from the staff members, the Principal has agreed to change the sitting pattern during the exams for which she has formed a committee. Using a spy, committee was able to get a list of close friends for all the students in the class. Now using this list they want to identify two groups of people such that a person in one group must not be a friend to any other in the same group. Your task is to help the committee
1
Expert's answer
2016-07-25T13:52:03-0400
Student.java: package sittingpattern;
public class Student { private int id; private String name;
public class SittingPattern { public static void main(String[] args) { Student st1 = new Student(1, "Bob"); Student st2 = new Student(2, "Anna"); Student st3 = new Student(3, "Frank"); Student st4 = new Student(4, "Elena"); Student st5 = new Student(5, "Kim");
Comments
Leave a comment