「二分探索」の版間の差分

削除された内容 追加された内容
Soulbot (会話 | 投稿記録)
116行目:
</th><td>×</td><td>'''×'''</td><td>'''×'''</td><td>×</td><td>'''×'''</td><td>×</td><td>×</td><td>×</td><td>×</td><td>×</td><tr>
</table>
 
===データが見つからない例(2)===
下記のような配列から'''''29'''''を探しだすことを考える。なお、同一のデータは無いものとする。
 
<table border="1" cellpadding="2" >
<tr><th>位置</th><th>&nbsp;1</th><th>&nbsp;2</th><th>&nbsp;3</th><th>&nbsp;4</th><th>&nbsp;5</th><th>&nbsp;6</th><th>&nbsp;7</th><th>&nbsp;8</th><th>&nbsp;9</th><th>10</th></tr>
<tr><th>データ
</th><td>&nbsp;1</td><td>&nbsp;3</td><td>&nbsp;5</td><td>11</td><td>12</td><td>13</td><td>17</td><td>22</td><td>25</td><td>28</td></tr>
</table>
 
データの全体の一番右側が29より小さいので、データが見つからないという結果になる。
 
==関連項目==