<?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="Merge algorithm - Page 6 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=merge_algorithm&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=merge_algorithm&amp;p=7">3.Next</a>
</p>

<p>When the inputs are linked lists, this algorithm can be implemented to use only a constant amount of working space; the pointers in the lists' nodes can be reused for bookkeeping and for constructing the final merged list.</p>

<p>In the merge sort algorithm, this <a href="page.php?w=subroutine">subroutine</a> is typically used to merge two sub-arrays ,  of a single array . This can be done by copying the sub-arrays into a temporary array, then applying the merge algorithm above. The allocation of a temporary array can be avoided, but at the</p><p>
<a accesskey="1" href="page.php?w=merge_algorithm&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=merge_algorithm&amp;p=7">3.Next</a>
</p>

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

</card>
</wml>
