title: An array of mutable arrays in Swift
body: <p>I am trying to implement an adjacency list in Swift, basically a collection of lists, or I guess a collection of mutable arrays. I wrote a Depth Search First implementation in Java for and I would like to write the same in Swift. This code of for the Graph representation. Any ideas of how to do this? Here is the code in Java if that helps:</p>
  
  <pre><code>public class Graph
  {
  
      private List&lt;Integer&gt;[] adj;
  
      public Graph(int numberOfVertices)
      {
           adj = (List&lt;Integer&gt;[]) new List[numberOfVertices];
           ...
           for(int i = 0; i &lt; numberOfVertices; i++)
                 adj[i] = new ArrayList&lt;Integer&gt;(); 
  
      }
  </code></pre>
  
  <p>Even knowing how to declare a variable that contains an array of mutable arrays would be great. I didn't find any information on how to do this in the book released by apple or the web. </p>