<?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="Linear search - Page 3 - Wikipedia">
<p>
<a accesskey="1" href="page.php?w=Linear_search&amp;p=2">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Linear_search&amp;p=4">3.Next</a>
</p>
<p>sequentially checks each element of the list until it finds an element that matches the target value. If the <a href="page.php?w=algorithm">algorithm</a> reaches the end of the list, the search terminates unsuccessfully.</p>

<p><big>Basic algorithm</big></p>
<p>Given a list  of  elements with values or <a href="page.php?w=Record_%28computer_science%29">records</a> , and target value , the following <a href="page.php?w=subroutine">subroutine</a> uses linear search to find the index of the target  in .</p>

<p>
# Set  to 0.<br/>
# If , the search terminates</p><p>
<a accesskey="1" href="page.php?w=Linear_search&amp;p=2">1.Previous</a><br />
<a accesskey="3" href="page.php?w=Linear_search&amp;p=4">3.Next</a>
</p>

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

</card>
</wml>
