issues with iterative code in java
<p>I want to convert the recursive function given below:</p>

<pre><code> LinkedList i=a; //a contains the nodes which are adjacent to the last element of g
 for(String i1: i )
{
  if(g.contains(i1) || i1.equals("o"))
   { continue; }
  g.addLast(i1);
  func(g);
  g.removeLast();
}
</code></pre>

<p>I want to convert the above program to an iterative one. Can someone help</p>
