title: find longest linked lists in an array of linked lists
body: <p>I have an array of linked lists (an adjacency list) most of the lengths of the linked lists are 4 but there are some that will randomly have more than that. My goal is to go through the array and find the ones that are more than length 4 (thats the easy part) then add the index's to an array so something like</p>
  
  <pre><code>for (int i = 0; i &lt; 1000; i++){
      if(sWorld[i].length &gt; 4)
           //add i to an array
           // then sort the array
  </code></pre>
  
  <p>couldnt really figure out how to do this. i tried to add to a inked list then linked list toArray() but then it was messing up. i just dont really know how to add the 'i' point in my sWorld array to say the first position in the new array im going to use for the ones that are grater than size 4.</p>
  
  <p>Any help would be much appreciated!</p>
  
  <p><strong>EDITED TO CLARIFY A BIT</strong></p>
  
  <p>i need the indexes of the the locations that are size > 4, but then i want to know which of those indexes that i get have the greatest size. Maybe i wasnt 100% clear in my op, but basically im trying to find which of the 1000 indexes in the array have the most connections (the longest linked list) make sense?</p>
  
  <p>I want to know the top 10 connected indexes of the array (aka which 10 have the greatest size of linked list)</p>