<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>NHÓM_12_CTDL&amp;GT by Dũng Tô</title>
      <link>https://padlet.com/tothanhdung2k2/nhom12</link>
      <description>Tìm kiếm chuỗi</description>
      <language>en-us</language>
      <pubDate>2022-01-10 09:02:12 UTC</pubDate>
      <lastBuildDate>2022-01-10 12:15:05 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f914.png</url>
      </image>
      <item>
         <title></title>
         <author>tothanhdung2k2</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983413013</link>
         <description><![CDATA[<div>1.Tô Thành Dũng-2050531200120<br>2.Hồ Quang Hải- 2050531200137<br>3.Lưu Văn Tùng-2050531200323<br>4.Phạm Văn Tài-2050531200304</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 09:10:56 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983413013</guid>
      </item>
      <item>
         <title></title>
         <author>tothanhdung2k2</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983417267</link>
         <description><![CDATA[<ul><li>String-matching được hiểu là việc tìm một hoặc nhiều xâu mẫu (pattern) xuất hiện trong một văn bản (có thể là rất dài). Ký hiệu xâu mẫu hay xâu cần tìm là X =(x0, x1,..,xm-1) có độ dài m. Văn bản Y =(y0, y1,..,yn-1) có độ dài n. Cả hai xâu được xây dựng từ một tập hữu hạn các ký tự Alphabet ký hiệu là  với kích cỡ là . Như vậy một xâu nhị phân có độ dài n ứng dụng trong mật mã học cũng được xem là một mẫu. Một chuỗi các ký tự ABD độ dài m biểu diễn các chuỗi AND cũng là một mẫu.</li><li>Input: Xâu mẫu X =(x0, x1,.., xm), độ dài m. Văn bản Y =(y0, x1,.., yn), độ dài n.</li><li>Output: Tất cả vị trí xuất hiện của X trong Y.</li></ul><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 09:13:45 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983417267</guid>
      </item>
      <item>
         <title></title>
         <author>tothanhdung2k2</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983423828</link>
         <description><![CDATA[<div><strong><em>Đặc điểm:</em></strong><br><br></div><ul><li>Là thuật toán tìm kiếm mẫu từ trái qua phải</li><li>Không có pha chuẩn bị</li><li>Bộ nhớ cần dùng cố định</li><li>Luôn luôn dịch 1 bước sang phải</li><li>Việc so sánh có thể phải dùng trong các trường hợp</li><li>Độ phức tạp pha thực thi là O(m x n)</li></ul><div><br></div><div><strong><em>Thuật toán:<br></em></strong><br></div><div>	for ( j = 0; j &lt;= (n-m); j++)&nbsp;<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;{ //duyệt từ trái qua phải xâu X<br>	&nbsp; &nbsp; &nbsp; &nbsp; for (i =0; i&lt;m &amp;&amp; X[i] == Y[i+j]; i++) ; //Kiểm tra mẫu<br>		&nbsp; &nbsp; if (i&gt;=m) OUTPUT (j);<br>	&nbsp; &nbsp;}</div><div><br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 09:18:09 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983423828</guid>
      </item>
      <item>
         <title>Đặc điểm:</title>
         <author>vantung260902</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983463549</link>
         <description><![CDATA[<ul><li>Thuật toán thực thi việc so sánh từ phải sang trái</li><li>Pha cài đặt có độ phức tạp thuật toán và không gian nhớ là O(m+σ)</li><li>Pha thực thi có độ phức tạp là O(mxn)</li><li>3n kí tự xâu văn bản được so sánh trong trường hợp xấu nhất khi thực thi với mẫu không tuần hoànĐộ phức tạp O(n/m) khi thực thi tốt nhất.</li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 09:43:59 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983463549</guid>
      </item>
      <item>
         <title>Thuật toán:</title>
         <author>vantung260902</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983470089</link>
         <description><![CDATA[<ul><li>Thuật toán sẽ quét các ký tự của mẫu (pattern) từ phải sang trái bắt đầu ở phần tử cuối cùng.</li><li>Trong trường hợp mis-match (hoặc là trường hợp đã tìm được 1 đoạn khớp với mẫu), nó sẽ dùng 2 hàm được tính toán trước để dịch cửa sổ sang bên phải. Hai hàm dịch chuyển này được gọi là good-suffix shift (còn được biết với cái tên phép dịch chuyển khớp) và bad-character shift (còn được biết với cái tên phép dịch chuyển xuất hiện).<ul><li><pre><strong>void</strong> <strong>preBmBc</strong>(<strong>char</strong> *x, <strong>int</strong> m, <strong>int</strong> bmBc[]) 
{
     <strong>int</strong> i;
     <strong>for</strong> (i = 0; i &lt; ASIZE; ++i)
         bmBc[i] = m;
     <strong>for</strong> (i = 0; i &lt; m - 1; ++i)
         bmBc[x[i]] = m - i - 1;
}
<strong>void</strong> <strong>suffixes</strong>(<strong>char</strong> *x, <strong>int</strong> m, <strong>int</strong> *suff) 
{
     <strong>int</strong> f, g, i;
     suff[m - 1] = m;
     g = m - 1;
     <strong>for</strong> (i = m - 2; i &gt;= 0; --i) 
     {
       <strong>if</strong> (i &gt; g &amp;&amp; suff[i + m - 1 - f] &lt; i - g)
          suff[i] = suff[i + m - 1 - f];
       <strong>else</strong> 
        {
          <strong>if</strong> (i &lt; g)
             g = i;
             f = i;
       <strong>while</strong> (g &gt;= 0 &amp;&amp; x[g] == x[g + m - 1 - f])
           g--;
       suff[i] = f - g;
         }
      }
}
<strong>void</strong> <strong>preBmGs</strong>(<strong>char</strong> *x, <strong>int</strong> m, <strong>int</strong> bmGs[]) 
{
    <strong>int</strong> i, j, suff[XSIZE];
    suffixes(x, m, suff);
    <strong>for</strong> (i = 0; i &lt; m; ++i)
       bmGs[i] = m;
       j = 0;
    <strong>for</strong> (i = m - 1; i &gt;= 0; --i) 
       <strong>if</strong> (suff[i] == i + 1)
    <strong>for</strong> (; j &lt; m - 1 - i; ++j)
       <strong>if</strong> (bmGs[j] == m)
          bmGs[j] = m - 1 - i;
    <strong>for</strong> (i = 0; i &lt;= m - 2; ++i)
        bmGs[m - 1 - suff[i]] = m - 1 - i;
}
<strong>void</strong> <strong>BM</strong>(<strong>char</strong> *x, <strong>int</strong> m, <strong>char</strong> *y, <strong>int</strong> n) 
{
    <strong>int</strong> i, j, bmGs[XSIZE], bmBc[ASIZE];
    <em>/* Preprocessing */</em>
    preBmGs(x, m, bmGs);
    preBmBc(x, m, bmBc);
    <em>/* Searching */</em>
    j = 0;
    <strong>while</strong> (j &lt;= n - m)
    {
       <strong>for</strong> (i = m - 1; i &gt;= 0 &amp;&amp; x[i] == y[i + j]; --i);
          <strong>if</strong> (i &lt; 0)
          {
              printf("position is %d",j);
              j += bmGs[0];
           }
          <strong>else</strong>
               j += max(bmGs[i], bmBc[y[i + j]] - m + 1 + i);
     }
}</pre></li></ul></li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 09:48:23 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983470089</guid>
      </item>
      <item>
         <title></title>
         <author>haitac731</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983508261</link>
         <description><![CDATA[<div>Đặc điểm :</div><ul><li>Sử dụng hàm băm</li><li>Pha chuẩn bị có độ phức tạp thuật toán và không gian lưu trữ O(m)</li><li>Chương trình chạy có độ phức tạp O(m+n)</li></ul>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 10:14:49 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983508261</guid>
      </item>
      <item>
         <title></title>
         <author>haitac731</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983508760</link>
         <description><![CDATA[<div>Thuật toán:</div><div>Hàm băm cung cấp phương thức đơn giản để tránh những con số phức tạp trong việc so sánh những kí tự trong hầu hết các trường hợp thực tế. Thay cho việc kiểm tra từng vị trí trong văn bản nếu như có mẫu xuất hiện, nó chỉ phải kiểm tra những đoạn “gần giống” xâu mẫu. Để kiểm tra sự giống nhau giữa 2 từ sử dụng hàm băm. Giúp cho việc đối chiếu xâu, hàm băm hash:<br><br></div><ul><li>Có khả năng tính toán được</li><li>Đánh giá xâu mức cao.</li><li>Hash(y[j+1…j+m]) được tính toán dễ hơn dựa trên hash(y[j…j+m-1]) và hash(y[j+m]).</li></ul><pre>void KR(char *x, int m, char *y, int n) 
{
    int d, hx, hy, i, j;
    /* Preprocessing */
    /* computes d = 2^(m-1) with the left-shift operator */
    for (d = i = 1; i &lt; m; ++i) d = (d&lt;&lt;1);
    for (hy = hx = i = 0; i &lt; m; ++i) 
     {
        hx = ((hx&lt;&lt;1) + x[i]);
        hy = ((hy&lt;&lt;1) + y[i]);
      }
    /* Searching */
    j = 0;
    while (j &lt;= n-m) 
    {
        if (hx == hy &amp;&amp; memcmp(x, y + j, m) == 0)
        printf("position is %d
",j);
        hy = REHASH(y[j], y[j + m], hy);
        ++j;
    }
}</pre>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 10:15:11 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983508760</guid>
      </item>
      <item>
         <title>Đặc điểm</title>
         <author>2050531200304</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983610968</link>
         <description><![CDATA[<ul><li>Sử dụng dụng bad- character</li><li>Dễ để cài đặt</li><li>Pha cài đặt có độ phức tạp thuật toán là O(m+σ) và độ phức tạp bộ nhớ là O(σ)</li><li>Độ phức tạp là O(mxn)</li></ul><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 11:33:43 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983610968</guid>
      </item>
      <item>
         <title>Thuật Toán</title>
         <author>2050531200304</author>
         <link>https://padlet.com/tothanhdung2k2/nhom12/wish/1983615805</link>
         <description><![CDATA[<ul><li>Quy tắc dịch bad- character được sử dụng trong Boyer Moore không có hiệu quả trong đoạn văn bản kí tự nhỏ, nhưng khi đoạn văn bản là lớn và phải so sánh với mẫu dài, nó thường trong trường hợp bảng bã ASCII và tìm kiếm thông thường trong soạn thảo văn bản, chúng rất h ữu dụng. Sử dụng nó như những kết quả riêng biệt lại rất hiệu quả.</li><li>void HORSPOOL(char *x, int m, char *y, int n) {<br>int j, bmBc[ASIZE];<br>char c;<br>/* Preprocessing */<br>preBmBc(x, m, bmBc);<br>/* Searching */<br>j = 0;<br>while (j &lt;= n - m) {<br>c = y[j + m - 1];<br>if (x[m - 1] == c &amp;&amp; memcmp(x, y + j, m - 1) == 0)<br>printf("position is %d\n",j);<br>j += bmBc[c];<br>}<br>}</li></ul><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 11:37:44 UTC</pubDate>
         <guid>https://padlet.com/tothanhdung2k2/nhom12/wish/1983615805</guid>
      </item>
   </channel>
</rss>
