Suppose we wish to examine phone records and "suggest" calling-circles to customers. We are going to define calling-circle in the following way. Suppose the records show that "Ali" talks to "Bill" (it doesn't matter who actually dials), "Bill" talks to "Chen", and "Dave" talks to "Ella". Then, we can identify two calling circles: "Ali-Bill-Chen" and "Dave-Ella". Thus, a calling circle includes pairs who may not have had a direct conversation, but linked via a sequence of conversations.
The starting template for this problem is CallingCircle.java.
Data will be provided in a 2D array of int's:
static int findNumCallingCircles (int[][] conversations) { // conversations[i][j] == 1 if i has had a conversation with j. // conversations[i][j] == 0 otherwise. }
Start by writing pseudocode.