<?xml version="1.0" encoding='utf-8'?>
<!DOCTYPE wml PUBLIC "-//WAPFORUM//DTD WML 1.1//EN" "http://www.wapforum.org/DTD/wml_1.1.xml">
<wml>
<card id="card1" title="Prüfer sequence - Page 5 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Prüfer_sequence&amp;p=4">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Pr%C3%BCfer_sequence&amp;p=6">3.Next</a>
</p>

<p>Next, for each number in the sequence <code>a[i]</code>, find the first (lowest-numbered) node, <code>j</code>, with degree equal to 1, add the edge <code>(j, a[i])</code> to the tree, and decrement the degrees of <code>j</code> and <code>a[i]</code>. In pseudo-code:</p>

<p>  8 <b>for</b> each value  in  <b>do</b>  9     <b>for</b> each node  in  <b>do</b> 10         <b>if</b> degree[] = 1 <b>then</b> 11             Insert edge[, ] into  12             degree[] <- degree</i>[] - 1 13             degree[] <- degree</i>[] - 1 14             <b>break</b></-></-></p><p>
<a accesskey="1" href="page.php?w=Prüfer_sequence&amp;p=4">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Pr%C3%BCfer_sequence&amp;p=6">3.Next</a>
</p>

<do type="prev" label="Search">
        <go href="search.wml"/>
</do>

</card>
</wml>
