title: Interpreting data from an array java
body: <p>I have an assignment that requires me to take a large dataset, store it in an array, and then create methods that interpret the data in various ways. The file data I am given is in the form like so: </p>
  
  <p>0  138<br>
      0   139<br>
      0   140<br>
      0   141<br>
      0   142<br>
      0   799<br>
      4   1<br>
      4   10<br>
      4   12<br>
      4   18<br>
  etc... (it is very large)
  This data is supposed to represent a social network of people, with the numbers representing individuals. Each line contains a person on the left who has 'trusted' the person on the right. I am supposed to interpret this data so that I can find all the persons a particular person trusts, how many people trust a particular person, and how to find the most trusted person. However, I am at a complete loss as to how to write these methods, and so I was wondering if you guys could help me out. Here's the code I have so far:</p>
  
  <pre><code>public class SocialNetwork {
  
  static Scanner scanner = new Scanner(System.in);
  static void findTrusted()
  {
      System.out.println("Please input person number you would like to find Trustees for");
      trustee = (scanner.next());
  }
  
  
  public static void main(String[] args){
      File inData = new File("dataset.txt");
      ArrayList&lt;Integer&gt; links = new ArrayList&lt;Integer&gt;();
      try
      {   
          Scanner in = new Scanner(inData);
          in.nextLine();
          in.nextLine();
          in.nextLine();
          in.nextLine();
          while (in.hasNext())
          {
              int trustee = in.nextInt();
              int trusted = in.nextInt();
              links.add(trustee);
              links.add(trusted);
  
  
          }
          in.close();
      }
  
      catch (FileNotFoundException e){
          e.printStackTrace();
      }
  }   
  }
  </code></pre>
  
  <p>As you can see, my findTrustee method has very little in it. I just don't know where to even start. I have come up with a little pseudocode to try and dissect what needs to be done:</p>
  
  <ol>
  <li>prompt user for input on which person(integer) to find his/her trustees  </li>
  <li>search arraylist links for person(integer) inputted  </li>
  <li>print all persons(integers) on the right side of the lines that begin with person requested</li>
  </ol>
  
  <p>However, I just don't quite know how to do this.  </p>