title: Remove binary search
body: <p>I'm working on a Path method that returns the path from the given node to the node with the key of a given value. My code returns the correct numbers, but they are inside a bracket. How do I remove the bracket?</p>
  
  <pre><code> private boolean pathhelp(Node n, int val, ArrayList&lt;Integer&gt; lst){
      if(n == null){
          return false;
      }else if(val &lt; n.key){
          lst.add(n.key);
          return pathhelp(n.left, val, lst);
      }else if(val &gt; n.key ){
          lst.add(n.key);
          return pathhelp(n.right, val, lst);
      }else{
          lst.add(n.key);
          return true;
      }
    }
     public String path(Node node, int value) {
      ArrayList&lt;Integer&gt; path = new ArrayList&lt;Integer&gt;();
  
      if(pathhelp(root,value,path) == true ){
          System.out.println(path);
          String p = "";
          //build p from path list
  
          return p;
      }else{
          return "";
      }
   }
    }
  </code></pre>
  
  <p>The actual output is:</p>
  
  <pre><code>[6, 5, 1, 4]
  </code></pre>
  
  <p>But it is supposed to be:</p>
  
  <pre><code>6, 5, 1, 4
  </code></pre>