<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="th">
	<id>http://158.108.32.49/wiki/index.php?action=history&amp;feed=atom&amp;title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552%2F%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I%2F%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2</id>
	<title>418531 ภาคต้น 2552/โจทย์ปัญหาอัลกอริทึมแบบตะกละ I/เฉลยข้อ 2 - ประวัติรุ่นแก้ไข</title>
	<link rel="self" type="application/atom+xml" href="http://158.108.32.49/wiki/index.php?action=history&amp;feed=atom&amp;title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552%2F%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I%2F%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2"/>
	<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;action=history"/>
	<updated>2026-05-07T01:36:52Z</updated>
	<subtitle>ประวัติรุ่นแก้ไขของหน้านี้ในวิกิ</subtitle>
	<generator>MediaWiki 1.33.1</generator>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7542&amp;oldid=prev</id>
		<title>Aoy: /* การพิสูจน์ความถูกต้องของอัลกอริทึม */</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7542&amp;oldid=prev"/>
		<updated>2009-09-19T07:59:38Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;การพิสูจน์ความถูกต้องของอัลกอริทึม&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:59, 19 กันยายน 2552&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-l23&quot; &gt;แถว 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;==&amp;#039;&amp;#039;การพิสูจน์ความถูกต้องของอัลกอริทึม&amp;#039;&amp;#039;==&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;==&amp;#039;&amp;#039;การพิสูจน์ความถูกต้องของอัลกอริทึม&amp;#039;&amp;#039;==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;จะทำการพิสูจน์โดยใช้เทคนิค greedy algorithm นำหน้าเสมอ ดังนี้ ให้ &amp;lt;math&amp;gt; Y_i \, &amp;lt;/math&amp;gt; คือตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ให้ &amp;lt;math&amp;gt; Y_i^G \, &amp;lt;/math&amp;gt; คือ ตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่ตาม greedy algorithm ข้างต้น ส่วน math&amp;gt; Y_i^A \, &amp;lt;/math&amp;gt; คือ ตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่ตาม algorithm อื่น ๆ จะพิสูจน์ว่า &amp;lt;math&amp;gt; Y_i^G  \leq Y_i^A \, &amp;lt;/math&amp;gt; เสมอ นั่นคือถ้ามีสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่เหมือนกับสตริงใน &amp;lt;math&amp;gt; S&amp;#039; \,&amp;lt;/math&amp;gt; ตำแหน่งที่เรากำลังพิจารณาแล้ว greedy algorithm จะสามารถจับคู่ได้เสมอ จะพิสูจน์โดยใช้ strong induction กรณี base case ให้ &amp;lt;math&amp;gt; i=1 \,&amp;lt;/math&amp;gt; เนื่องจาก greedy algorithm จะจับคู่สตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ตัวแรกสุดที่เหมือนกัน ดังนั้นถ้ามีสตริงใน &amp;lt;math&amp;gt; S \,&amp;lt;/math&amp;gt; ที่เหมือนกับสตริงตัวแรกใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; แล้ว &amp;lt;math&amp;gt; Y_1^G \leq Y_1^A \,&amp;lt;/math&amp;gt; เสมอ กรณี indutive step  สมมติให้ &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i &amp;lt; n \, &amp;lt;/math&amp;gt; พิจารณากรณีที่กำลังจับคู่ให้กับสตริงตัวที่ &amp;lt;math&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;m &lt;/del&gt;\,&amp;lt;/math&amp;gt; ใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ถ้ามีสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่เหมือนกับสตริงใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ตำแหน่งที่ &amp;lt;math&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;m &lt;/del&gt;\, &amp;lt;/math&amp;gt; แล้ว เนื่องจาก greedy algorithm จะจับตัวแรกที่เหมือนกัน ซึ่ง ถ้ามีแค่ตัวเดียวจะได้ว่า &amp;lt;math&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Y_m&lt;/del&gt;^G = &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Y_m&lt;/del&gt;^A \,&amp;lt;/math&amp;gt; แต่ถ้ามีตัวที่เหมือนกันมากกว่าหนึ่งตัวแล้ว &amp;lt;math&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Y_m&lt;/del&gt;^G &amp;lt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Y_m&lt;/del&gt;^A \,&amp;lt;/math&amp;gt; เนื่องจาก &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i &amp;lt; n \, &amp;lt;/math&amp;gt; และ &amp;lt;math&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Y_m&lt;/del&gt;^G \leq &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;Y_m&lt;/del&gt;^A \,&amp;lt;/math&amp;gt;  ดังนั้น &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i \leq n \, &amp;lt;/math&amp;gt; จะได้ว่าสำหรับสตริง &amp;lt;math&amp;gt; &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;m &lt;/del&gt;\, &amp;lt;/math&amp;gt; ตัวใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ถ้ามีสตริงที่เหมือนกันในสตริง &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; แล้ว greedy algorithm จะตอบ &amp;quot;ใช่&amp;quot; เสมอ&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;จะทำการพิสูจน์โดยใช้เทคนิค greedy algorithm นำหน้าเสมอ ดังนี้ ให้ &amp;lt;math&amp;gt; Y_i \, &amp;lt;/math&amp;gt; คือตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ให้ &amp;lt;math&amp;gt; Y_i^G \, &amp;lt;/math&amp;gt; คือ ตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่ตาม greedy algorithm ข้างต้น ส่วน &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;&amp;lt;&lt;/ins&gt;math&amp;gt; Y_i^A \, &amp;lt;/math&amp;gt; คือ ตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่ตาม algorithm อื่น ๆ จะพิสูจน์ว่า &amp;lt;math&amp;gt; Y_i^G  \leq Y_i^A \, &amp;lt;/math&amp;gt; เสมอ นั่นคือถ้ามีสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่เหมือนกับสตริงใน &amp;lt;math&amp;gt; S&amp;#039; \,&amp;lt;/math&amp;gt; ตำแหน่งที่เรากำลังพิจารณาแล้ว greedy algorithm จะสามารถจับคู่ได้เสมอ จะพิสูจน์โดยใช้ strong induction กรณี base case ให้ &amp;lt;math&amp;gt; i=1 \,&amp;lt;/math&amp;gt; เนื่องจาก greedy algorithm จะจับคู่สตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ตัวแรกสุดที่เหมือนกัน ดังนั้นถ้ามีสตริงใน &amp;lt;math&amp;gt; S \,&amp;lt;/math&amp;gt; ที่เหมือนกับสตริงตัวแรกใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; แล้ว &amp;lt;math&amp;gt; Y_1^G \leq Y_1^A \,&amp;lt;/math&amp;gt; เสมอ กรณี indutive step  สมมติให้ &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i &amp;lt; n \, &amp;lt;/math&amp;gt; พิจารณากรณีที่กำลังจับคู่ให้กับสตริงตัวที่ &amp;lt;math&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;n &lt;/ins&gt;\,&amp;lt;/math&amp;gt; ใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ถ้ามีสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่เหมือนกับสตริงใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ตำแหน่งที่ &amp;lt;math&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;n &lt;/ins&gt;\, &amp;lt;/math&amp;gt; แล้ว เนื่องจาก greedy algorithm จะจับตัวแรกที่เหมือนกัน ซึ่ง ถ้ามีแค่ตัวเดียวจะได้ว่า &amp;lt;math&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Y_n&lt;/ins&gt;^G = &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Y_n&lt;/ins&gt;^A \,&amp;lt;/math&amp;gt; แต่ถ้ามีตัวที่เหมือนกันมากกว่าหนึ่งตัวแล้ว &amp;lt;math&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Y_n&lt;/ins&gt;^G &amp;lt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Y_n&lt;/ins&gt;^A \,&amp;lt;/math&amp;gt; เนื่องจาก &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i &amp;lt; n \, &amp;lt;/math&amp;gt; และ &amp;lt;math&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Y_n&lt;/ins&gt;^G \leq &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;Y_n&lt;/ins&gt;^A \,&amp;lt;/math&amp;gt;  ดังนั้น &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i \leq n \, &amp;lt;/math&amp;gt; จะได้ว่าสำหรับสตริง &amp;lt;math&amp;gt; &lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;n &lt;/ins&gt;\, &amp;lt;/math&amp;gt; ตัวใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ถ้ามีสตริงที่เหมือนกันในสตริง &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; แล้ว greedy algorithm จะตอบ &amp;quot;ใช่&amp;quot; เสมอ&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7541&amp;oldid=prev</id>
		<title>Aoy: /* อัลกอริทึม */</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7541&amp;oldid=prev"/>
		<updated>2009-09-19T07:56:18Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;อัลกอริทึม&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:56, 19 กันยายน 2552&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-l21&quot; &gt;แถว 21:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 21:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;     }&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;     }&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;&amp;lt;/geshi&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;&amp;lt;/geshi&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==&amp;#039;&amp;#039;การพิสูจน์ความถูกต้องของอัลกอริทึม&amp;#039;&amp;#039;==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt; &lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;จะทำการพิสูจน์โดยใช้เทคนิค greedy algorithm นำหน้าเสมอ ดังนี้ ให้ &amp;lt;math&amp;gt; Y_i \, &amp;lt;/math&amp;gt; คือตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ให้ &amp;lt;math&amp;gt; Y_i^G \, &amp;lt;/math&amp;gt; คือ ตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่ตาม greedy algorithm ข้างต้น ส่วน math&amp;gt; Y_i^A \, &amp;lt;/math&amp;gt; คือ ตำแหน่งของสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่กับสตริงตัวที่ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; ของ &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ที่ถูกจับคู่ตาม algorithm อื่น ๆ จะพิสูจน์ว่า &amp;lt;math&amp;gt; Y_i^G  \leq Y_i^A \, &amp;lt;/math&amp;gt; เสมอ นั่นคือถ้ามีสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่เหมือนกับสตริงใน &amp;lt;math&amp;gt; S&amp;#039; \,&amp;lt;/math&amp;gt; ตำแหน่งที่เรากำลังพิจารณาแล้ว greedy algorithm จะสามารถจับคู่ได้เสมอ จะพิสูจน์โดยใช้ strong induction กรณี base case ให้ &amp;lt;math&amp;gt; i=1 \,&amp;lt;/math&amp;gt; เนื่องจาก greedy algorithm จะจับคู่สตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ตัวแรกสุดที่เหมือนกัน ดังนั้นถ้ามีสตริงใน &amp;lt;math&amp;gt; S \,&amp;lt;/math&amp;gt; ที่เหมือนกับสตริงตัวแรกใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; แล้ว &amp;lt;math&amp;gt; Y_1^G \leq Y_1^A \,&amp;lt;/math&amp;gt; เสมอ กรณี indutive step  สมมติให้ &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i &amp;lt; n \, &amp;lt;/math&amp;gt; พิจารณากรณีที่กำลังจับคู่ให้กับสตริงตัวที่ &amp;lt;math&amp;gt; m \,&amp;lt;/math&amp;gt; ใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ถ้ามีสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ที่เหมือนกับสตริงใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ตำแหน่งที่ &amp;lt;math&amp;gt; m \, &amp;lt;/math&amp;gt; แล้ว เนื่องจาก greedy algorithm จะจับตัวแรกที่เหมือนกัน ซึ่ง ถ้ามีแค่ตัวเดียวจะได้ว่า &amp;lt;math&amp;gt; Y_m^G = Y_m^A \,&amp;lt;/math&amp;gt; แต่ถ้ามีตัวที่เหมือนกันมากกว่าหนึ่งตัวแล้ว &amp;lt;math&amp;gt; Y_m^G &amp;lt; Y_m^A \,&amp;lt;/math&amp;gt; เนื่องจาก &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i &amp;lt; n \, &amp;lt;/math&amp;gt; และ &amp;lt;math&amp;gt; Y_m^G \leq Y_m^A \,&amp;lt;/math&amp;gt;  ดังนั้น &amp;lt;math&amp;gt; Y_i^G \leq Y_i^A \,&amp;lt;/math&amp;gt; สำหรับ &amp;lt;math&amp;gt; 1 \leq i \leq n \, &amp;lt;/math&amp;gt; จะได้ว่าสำหรับสตริง &amp;lt;math&amp;gt; m \, &amp;lt;/math&amp;gt; ตัวใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ถ้ามีสตริงที่เหมือนกันในสตริง &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; แล้ว greedy algorithm จะตอบ &amp;quot;ใช่&amp;quot; เสมอ&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7540&amp;oldid=prev</id>
		<title>Aoy: /* อัลกอริทึม */</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7540&amp;oldid=prev"/>
		<updated>2009-09-19T07:37:56Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;อัลกอริทึม&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:37, 19 กันยายน 2552&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-l7&quot; &gt;แถว 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;FindSubString(S,m,S&lt;del class=&quot;diffchange diffchange-inline&quot;&gt;^&lt;/del&gt;&amp;#039;,n)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;FindSubString(S,m,S&amp;#039;,n)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;     {&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;     {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;      j = 1&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;      j = 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7539&amp;oldid=prev</id>
		<title>Aoy: /* อัลกอริทึม */</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7539&amp;oldid=prev"/>
		<updated>2009-09-19T07:37:42Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;อัลกอริทึม&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&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;th&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;←รุ่นแก้ไขก่อนหน้า&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #222; text-align: center;&quot;&gt;รุ่นแก้ไขเมื่อ 07:37, 19 กันยายน 2552&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-l7&quot; &gt;แถว 7:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;แถว 7:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt;−&lt;/td&gt;&lt;td style=&quot;color: #222; 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;FindSubString(S,m,S&amp;#039;,n)&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt;+&lt;/td&gt;&lt;td style=&quot;color: #222; 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;FindSubString(S,m,S&lt;ins class=&quot;diffchange diffchange-inline&quot;&gt;^&lt;/ins&gt;&amp;#039;,n)&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;     {&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;     {&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;      j = 1&lt;/div&gt;&lt;/td&gt;&lt;td class=&#039;diff-marker&#039;&gt; &lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #222; 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;      j = 1&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
	<entry>
		<id>http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7538&amp;oldid=prev</id>
		<title>Aoy: หน้าที่ถูกสร้างด้วย &#039;==&#039;&#039;อัลกอริทึม&#039;&#039;== ให้สตริงใน &lt;math&gt; S&#039; \, &lt;/math&gt; จับคู่กับสตริงใ…&#039;</title>
		<link rel="alternate" type="text/html" href="http://158.108.32.49/wiki/index.php?title=418531_%E0%B8%A0%E0%B8%B2%E0%B8%84%E0%B8%95%E0%B9%89%E0%B8%99_2552/%E0%B9%82%E0%B8%88%E0%B8%97%E0%B8%A2%E0%B9%8C%E0%B8%9B%E0%B8%B1%E0%B8%8D%E0%B8%AB%E0%B8%B2%E0%B8%AD%E0%B8%B1%E0%B8%A5%E0%B8%81%E0%B8%AD%E0%B8%A3%E0%B8%B4%E0%B8%97%E0%B8%B6%E0%B8%A1%E0%B9%81%E0%B8%9A%E0%B8%9A%E0%B8%95%E0%B8%B0%E0%B8%81%E0%B8%A5%E0%B8%B0_I/%E0%B9%80%E0%B8%89%E0%B8%A5%E0%B8%A2%E0%B8%82%E0%B9%89%E0%B8%AD_2&amp;diff=7538&amp;oldid=prev"/>
		<updated>2009-09-19T07:37:14Z</updated>

		<summary type="html">&lt;p&gt;หน้าที่ถูกสร้างด้วย &amp;#039;==&amp;#039;&amp;#039;อัลกอริทึม&amp;#039;&amp;#039;== ให้สตริงใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; จับคู่กับสตริงใ…&amp;#039;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;หน้าใหม่&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==&amp;#039;&amp;#039;อัลกอริทึม&amp;#039;&amp;#039;==&lt;br /&gt;
ให้สตริงใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; จับคู่กับสตริงใน &amp;lt;math&amp;gt; S \, &amp;lt;/math&amp;gt; ตัวแรกสุดที่เหมือนกัน ถ้าสตริงทุกตัวใน &amp;lt;math&amp;gt; S&amp;#039; \, &amp;lt;/math&amp;gt; ถูกจับคู่ได้หมดให้ตอบ &amp;quot;ใช่&amp;quot; ไม่เช่นั้นให้ตอบ &amp;quot;ไม่ใช่&amp;quot;&lt;br /&gt;
&lt;br /&gt;
ให้ &amp;lt;math&amp;gt; i \, &amp;lt;/math&amp;gt; เป็นตัวแปรที่ชี้ไปยังสตริงที่กำลังพิจารณาในสตริง &amp;lt;math&amp;gt; S \,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
ให้ &amp;lt;math&amp;gt; j \, &amp;lt;/math&amp;gt; เป็นตัวแปรที่ชี้ไปยังสตริงที่กำลังพิจารณาในสตริง &amp;lt;math&amp;gt; S&amp;#039; \,&amp;lt;/math&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;geshi lang=&amp;quot;c&amp;quot;&amp;gt;&lt;br /&gt;
FindSubString(S,m,S&amp;#039;,n)&lt;br /&gt;
    {&lt;br /&gt;
     j = 1&lt;br /&gt;
     for i = 1 to m do&lt;br /&gt;
     {&lt;br /&gt;
      if S[i] = S&amp;#039;[j] then&lt;br /&gt;
          j = j + 1&lt;br /&gt;
     }&lt;br /&gt;
     if j &amp;gt; n then&lt;br /&gt;
          return 1&lt;br /&gt;
     else&lt;br /&gt;
          return 0&lt;br /&gt;
    }&lt;br /&gt;
&amp;lt;/geshi&amp;gt;&lt;/div&gt;</summary>
		<author><name>Aoy</name></author>
		
	</entry>
</feed>