<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="et">
	<id>http://www.lambda.ee/w/index.php?action=history&amp;feed=atom&amp;title=Otsing_%28iti0140%29</id>
	<title>Otsing (iti0140) - Redigeerimiste ajalugu</title>
	<link rel="self" type="application/atom+xml" href="http://www.lambda.ee/w/index.php?action=history&amp;feed=atom&amp;title=Otsing_%28iti0140%29"/>
	<link rel="alternate" type="text/html" href="http://www.lambda.ee/w/index.php?title=Otsing_(iti0140)&amp;action=history"/>
	<updated>2026-10-28T14:27:53Z</updated>
	<subtitle>Selle lehekülje redigeerimiste ajalugu</subtitle>
	<generator>MediaWiki 1.43.11</generator>
	<entry>
		<id>http://www.lambda.ee/w/index.php?title=Otsing_(iti0140)&amp;diff=11068&amp;oldid=prev</id>
		<title>Gert – 19. november 2013, kell 17:24</title>
		<link rel="alternate" type="text/html" href="http://www.lambda.ee/w/index.php?title=Otsing_(iti0140)&amp;diff=11068&amp;oldid=prev"/>
		<updated>2013-11-19T17:24:46Z</updated>

		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;et&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←Vanem redaktsioon&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Redaktsioon: 19. november 2013, kell 19:24&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l3&quot;&gt;3. rida:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;3. rida:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Kahendotsingu sooritamiseks tuleks list enne ära sortida mõne pythoni sisseehitatud sortimisega. Jadaotsing ja kahendotsing realiseerida ise, jadaotsingu puhul teha ka tsükkel ise. Kahendotsingu lahendamiseks tuletage meelde, kuidas mängida arvu arvamise mängu.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Kahendotsingu sooritamiseks tuleks list enne ära sortida mõne pythoni sisseehitatud sortimisega. Jadaotsing ja kahendotsing realiseerida ise, jadaotsingu puhul teha ka tsükkel ise. Kahendotsingu lahendamiseks tuletage meelde, kuidas mängida arvu arvamise mängu.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;0. Ma mõtlen numbrist 0-100 vahel (&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ntx &lt;/del&gt;72).&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;0. Ma mõtlen numbrist 0-100 vahel (&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;nt &lt;/ins&gt;72).&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;1. Kas on 50-st suurem? Jah -&amp;gt; 50-100 vahel.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;1. Kas on 50-st suurem? Jah -&amp;gt; 50-100 vahel.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Gert</name></author>
	</entry>
	<entry>
		<id>http://www.lambda.ee/w/index.php?title=Otsing_(iti0140)&amp;diff=11066&amp;oldid=prev</id>
		<title>Gert: Uus lehekülg: &#039;&#039;&#039;&#039;Realiseerida etteantud mooduli peale kaks otsingu algoritmi: jada- ja kahendotsing. gimme_my_input funktsioonist saab kätte tuple, kus esimene element on list ja teine listi ...&#039;</title>
		<link rel="alternate" type="text/html" href="http://www.lambda.ee/w/index.php?title=Otsing_(iti0140)&amp;diff=11066&amp;oldid=prev"/>
		<updated>2013-11-19T17:21:40Z</updated>

		<summary type="html">&lt;p&gt;Uus lehekülg: &amp;#039;&amp;#039;&amp;#039;&amp;#039;Realiseerida etteantud mooduli peale kaks otsingu algoritmi: jada- ja kahendotsing. gimme_my_input funktsioonist saab kätte tuple, kus esimene element on list ja teine listi ...&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Uus lehekülg&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;#039;&amp;#039;&amp;#039;Realiseerida etteantud mooduli peale kaks otsingu algoritmi: jada- ja kahendotsing. gimme_my_input funktsioonist saab kätte tuple, kus esimene element on list ja teine listi genereerimiseks kasutatud juhuslike numbrite generaator. Kasutades generaatorit uute numbrite võtmiseks, sooritada listi pikkus korda otsinguid saadud listist. Kõigepealt tehes seda jadaotsinguga, siis kahendotsinguga.&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
Kahendotsingu sooritamiseks tuleks list enne ära sortida mõne pythoni sisseehitatud sortimisega. Jadaotsing ja kahendotsing realiseerida ise, jadaotsingu puhul teha ka tsükkel ise. Kahendotsingu lahendamiseks tuletage meelde, kuidas mängida arvu arvamise mängu.&lt;br /&gt;
&lt;br /&gt;
0. Ma mõtlen numbrist 0-100 vahel (ntx 72).&lt;br /&gt;
&lt;br /&gt;
1. Kas on 50-st suurem? Jah -&amp;gt; 50-100 vahel.&lt;br /&gt;
&lt;br /&gt;
2. Kas on 75-st suurem? Ei -&amp;gt; 50-75 vahel.&lt;br /&gt;
&lt;br /&gt;
3. Kas on 62-st suurem? Jah -&amp;gt; 62-75 vahel.&lt;br /&gt;
&lt;br /&gt;
4. Kas on 68-st suurem? Jah -&amp;gt; 68-75 vahel.&lt;br /&gt;
&lt;br /&gt;
5. Kas on 71-st suurem? Jah -&amp;gt; 71-75 vahel.&lt;br /&gt;
&lt;br /&gt;
6. Kas on 73-st suurem? Ei -&amp;gt; 71-73 vahel.&lt;br /&gt;
&lt;br /&gt;
7. Kas on 72? Jah&lt;br /&gt;
&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
Otsingu sooritamisel ei tohiks teha uusi liste. Kasutage olemaolevat listi ja ülemise ning alumise raja indeksit.&lt;br /&gt;
&lt;br /&gt;
Otsingufunktsioonide definitsioonideks võiks kasutada järgnevat. Teha eraldi funktsioonid sisendi saamiseks ja otsingute väljakutsumiseks.&lt;br /&gt;
	&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;def linear_search(lst, num):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Return True if found, False otherwise.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    pass&lt;br /&gt;
&lt;br /&gt;
    &amp;#039;&amp;#039;&amp;#039;def binary_search(lst, num):&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    Return True if found, False otherwise.&lt;br /&gt;
    &amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
    pass&lt;/div&gt;</summary>
		<author><name>Gert</name></author>
	</entry>
</feed>