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

<p><big> Procedure </big></p>
<p>Given an array  of  elements with values or <a href="page.php?w=Record_%28computer_science%29">records</a> sorted such that , and target value , the following <a href="page.php?w=subroutine">subroutine</a> uses binary search to find the index of  in .<br/>
# Set  to  and  to .<br/>
# If , the search terminates as unsuccessful.<br/>
# Set  (the position of the middle element) to  plus the <a href="page.php?w=Floor_and_ceiling_functions">floor</a> of , which is the greatest integer less than or equal to .<br/></p><p>
<a accesskey="1" href="page.php?w=binary_search&amp;p=5">1.Previous</a><br />
<a accesskey="3" href="page.php?w=binary_search&amp;p=7">3.Next</a>
</p>

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

</card>
</wml>
