</span><span class="n">top</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">t</span><span class="p">;</span>
<span class="w">	</span><span class="p">}</span><span class="w"> </span>
<span class="p">}</span>
</pre></div>
</div>
<ul class="simple">
<li><p>sort a stack with 2 stacks</p>
<ul>
<li><p>make a new stack called ans</p></li>
<li><p>pop from old</p></li>
<li><p>while old element is &gt; ans.peek(), old.push(ans.pop())</p></li>
<li><p>then new.push(old eleme