algorithm to list all possible paths
<p>I have dynamic 2D  array </p>

<p>Example with Javascript</p>

<pre><code>var arr = new Array();
     arr[0] = [1];
     arr[1] = [2,3];
     arr[2] = [4];
     arr[3] = [5,6];
</code></pre>

<p>Now i want output all paths from begin to end :</p>

<p>path 1: 1->2->4->5</p>

<p>path 2: 1->3->4->5</p>

<p>path 3: 1->2->4->6</p>

<p>path 4: 1->3->4->6</p>

<p>..................</p>
