t = zeros(1,n-2);
0033     
0034     <span class="keyword">for</span> i=1:n-2
0035         <span class="comment">% find least leaf</span>
0036         d = <a href="deg.html" class="code" title="function d = deg(g,v)">deg</a>(t);
0037         v = min(find(d==1));
0038         
0039         <span class="comment">% find neighbor of the least leaf</span>
0040         w = <a href="neighbors.html" class="code" title="function nlist = neighbors(g,v)">neighbors</a>(t,v);
0041         
0042         output(i) = names