<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Bài tập cuối kỳ Nhóm 3 by Nguyễn Văn Chương</title>
      <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky</link>
      <description>Thuật toán Quick Sort</description>
      <language>en-us</language>
      <pubDate>2022-01-10 12:28:11 UTC</pubDate>
      <lastBuildDate>2023-02-22 21:24:36 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url></url>
      </image>
      <item>
         <title>Thành Viên</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983685315</link>
         <description><![CDATA[<div>-Nguyễn Văn Chương(NT)<br>-Nguyễn Xuân Trường<br>-Bùi Minh Thành<br>-Phạm Như Hoàng<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 12:33:59 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983685315</guid>
      </item>
      <item>
         <title>Chủ đề</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983689782</link>
         <description><![CDATA[<div>1/THUẬT TOÁN SẮP XẾP NHANH(QUICK SORT)<br>2/ THUẬT TOÁN XỬ LÝ CHUỖI( TÌM KIẾM CHUỖI)</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 12:36:46 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983689782</guid>
      </item>
      <item>
         <title>Nhiệm vụ</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983711928</link>
         <description><![CDATA[<div>cài đặt và minh họa thuật toán</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 12:50:37 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983711928</guid>
      </item>
      <item>
         <title>Nhiệm vụ</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983715106</link>
         <description><![CDATA[<div>mô tả và giải thích</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 12:52:40 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983715106</guid>
      </item>
      <item>
         <title>Cài đặt thuật toán:</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983716747</link>
         <description><![CDATA[<div>#include&lt;stdio.h&gt;&nbsp;</div><div>void swap(int &amp;a, int &amp;b)</div><div>{</div><div>&nbsp; &nbsp; int t = a;</div><div>&nbsp; &nbsp; a = b;</div><div>&nbsp; &nbsp; b = t;</div><div>}</div><div>int partition (int arr[], int low, int high)</div><div>{</div><div>&nbsp; &nbsp; int pivot = arr[high];&nbsp; &nbsp; // pivot</div><div>&nbsp; &nbsp; int left = low;</div><div>&nbsp; &nbsp; int right = high - 1;</div><div>&nbsp; &nbsp; while(true){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while(left &lt;= right &amp;&amp; arr[left] &lt; pivot) left++;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while(right &gt;= left &amp;&amp; arr[right] &gt; pivot) right--;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (left &gt;= right) break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; swap(arr[left], arr[right]);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; left++;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; right--;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; swap(arr[left], arr[high]);</div><div>&nbsp; &nbsp; return left;</div><div>}</div><div>/* Hàm thực hiện giải thuật quick sort */</div><div>void quickSort(int arr[], int low, int high)</div><div>{</div><div>&nbsp; &nbsp; if (low &lt; high)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* pi là chỉ số nơi phần tử này đã đứng đúng vị trí</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;và là phần tử chia mảng làm 2 mảng con trái &amp; phải */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int pi = partition(arr, low, high);</div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Gọi đệ quy sắp xếp 2 mảng con trái và phải</div><div>&nbsp; &nbsp; &nbsp; &nbsp; quickSort(arr, low, pi - 1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; quickSort(arr, pi + 1, high);</div><div>&nbsp; &nbsp; }</div><div>}</div><div>/* Hàm xuất mảng */</div><div>void printArray(int arr[], int size)</div><div>{</div><div>&nbsp; &nbsp; int i;</div><div>&nbsp; &nbsp; for (i=0; i &lt; size; i++)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; printf("%d ", arr[i]);</div><div>&nbsp; &nbsp; printf("\n");</div><div>}</div><div>main()</div><div>{</div><div>&nbsp; &nbsp; int arr[] = {10, 80, 30, 90, 40, 50, 70};</div><div>&nbsp; &nbsp; int n = sizeof(arr)/sizeof(arr[0]);</div><div>&nbsp; &nbsp; quickSort(arr, 0, n-1);</div><div>&nbsp; &nbsp; printf("Sorted array: \n");</div><div>&nbsp; &nbsp; printArray(arr, n);</div><div>&nbsp; &nbsp; return 0;</div><div>}&nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 12:53:28 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983716747</guid>
      </item>
      <item>
         <title>Minh Họa</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983732110</link>
         <description><![CDATA[<div>VDMH: Cho dãy số có số phần tử n=5: <strong>10 5 7 3 1 4</strong> <strong><br>Pivot= 4</strong></div><div>Left= 0, Right=4</div><div>1&nbsp; 5&nbsp; 7&nbsp; 3&nbsp; 10&nbsp; 4</div><div>Left= 1, Right=3</div><div>1&nbsp; 3&nbsp; 7&nbsp; 5&nbsp; 10&nbsp; 4</div><div>Left= 2, Right=1</div><div>1&nbsp; 3&nbsp; 4&nbsp; 5&nbsp; 10&nbsp; 7</div><div><strong>Pivot= 3</strong></div><div>Left= 1, Right=0</div><div>1&nbsp; 3&nbsp; 4&nbsp; 5&nbsp; 10&nbsp; 7</div><div><strong>Pivot= 7</strong></div><div>Left= 4, Right=3<br>1&nbsp; 3&nbsp; 4&nbsp; 5&nbsp; 7&nbsp; 10<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1251431383/260a63962a2b25a1cca68a79e4ab6e16/sx_nhanh.gif" />
         <pubDate>2022-01-10 13:03:14 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983732110</guid>
      </item>
      <item>
         <title>Mô tả thuật toán</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983741277</link>
         <description><![CDATA[<div>Bước 1: Lấy phần tử chốt là phần tử ở cuối danh sách.</div><div>Bước 2: Chia mảng theo phần tử chốt.</div><div>Bước 3: Sử dụng sắp xếp nhanh một cách đệ qui với mảng con bên trái.</div><div>Bước 4: Sử dụng sắp xếp nhanh một cách đệ qui với mảng con bên phải.</div><div><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1251431383/2a329b6e243a58090fc60b4de69a946d/A_nh_chu_p_ma_n_hi_nh_2022_01_10_211626.gif" />
         <pubDate>2022-01-10 13:08:27 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983741277</guid>
      </item>
      <item>
         <title>Giải Thích Thuật toán</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983753655</link>
         <description><![CDATA[<div>Trong phần này chúng ta có hai giai đoạn. Giai đoạn một là giai đoạn phân đoạn mảng và giai đoạn hai là giai đoạn sắp xếp .<br><br>    Chọn pivot cho mảng, ở đây mình sẽ chọn pivot là số cuối cùng của mảng.<br>    Tạo hai biến là left và right để trỏ tới bên trái và bên phải của danh sách.<br>    Thực hiện so sánh các phần tử với pivot. Nếu phần tử nhỏ hơn pivot thì dịch chuyển qua bên trái và ngược lại.<br>    Sau khi dịch chuyển thực hiện công việc sắp xếp các phần tử trong mảng con mới, trước khi tiếp tục phân đoạn tiếp theo.</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:14:56 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983753655</guid>
      </item>
      <item>
         <title>Nhiệm vụ</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983759949</link>
         <description><![CDATA[<div>Định nghĩa &amp; nhận xét</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:18:09 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983759949</guid>
      </item>
      <item>
         <title>Định nghĩa</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983766321</link>
         <description><![CDATA[<div>QuickSort là một thuật toán Chia và Chinh phục. Nó chọn một phần tử làm trục và phân vùng mảng đã cho xung quanh trục đã chọn. Có nhiều phiên bản quickSort khác nhau chọn pivot theo những cách khác nhau.&nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:21:14 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983766321</guid>
      </item>
      <item>
         <title>Nhận xét</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983775254</link>
         <description><![CDATA[<div>Ưu điểm</div><ul><li>Tốc độ sắp xếp nhanh.</li><li>Được sử dụng trong nhiều thư viện của các ngôn ngữ như C++, Java, ...</li></ul><div>Nhược điểm</div><ul><li>Phụ thuộc vào cách chọn phần tử chốt.</li><li>Không ổn định.</li></ul><div>Nhận xét</div><div>        So với sắp xếp nổi bọt thì sắp xếp nhanh mỗi lần đổi chỗ mang tính nhảy vọt. Từng lượt ta chọn một phần tử chốt, đem những số nhỏ hơn nó đặt bên trái nó, những số lớn hơn nó đặt bên phải phải. Dẫn đến số lượt đổi chỗ được ít hơn so với sự đổi chỗ từng cặp của sắp xếp nổi bọt.&nbsp;</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:25:33 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983775254</guid>
      </item>
      <item>
         <title>Nhiệm vụ</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983784243</link>
         <description><![CDATA[<div>Xử Lý Chuỗi</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:29:56 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983784243</guid>
      </item>
      <item>
         <title>Mô tả </title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983788115</link>
         <description><![CDATA[<div>1/ So sánh chuỗi s2 với phần tử đầu chuỗi s1.<br>2/ Nếu không giống nhau thì dịch đến phần tử tiếp theo của chuỗi s1<br>3/ Đến khi đã tìm chuỗi s1 có trong chuỗi s2 thì dừng '\0'</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:31:51 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983788115</guid>
      </item>
      <item>
         <title>Cài đặt thuật toán</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983790310</link>
         <description><![CDATA[<div>#include &lt;stdio.h&gt;<br>#include &lt;conio.h&gt;<br>#include &lt;string.h&gt;<br>&nbsp;<br>int findsubstr(const char *str, char *sub)<br>{<br>&nbsp; &nbsp; const char *p = str;<br>&nbsp; &nbsp; int len = strlen(sub);<br>&nbsp; &nbsp; while(*p != NULL)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; if (strlen(p) &gt;= len)<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (strncmp(p, sub, strlen(sub)) == 0)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (p - str + 1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; p++;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; return 0;<br>}<br>&nbsp;<br>main()<br>{<br>&nbsp; &nbsp; char str[] = "vncoding.net blog for developer";<br>&nbsp; &nbsp; char sub1[] = "blog";<br>&nbsp; &nbsp; printf("str = '%s'\n", str);<br>&nbsp; &nbsp; printf("'%s' at %d\n", sub1, findsubstr(str, sub1));<br>&nbsp; &nbsp; getch();<br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:32:57 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983790310</guid>
      </item>
      <item>
         <title>Định nghĩa</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983844886</link>
         <description><![CDATA[<div>QuickSort là một thuật toán Chia và Chinh phục. Nó chọn một phần tử làm trục và phân vùng mảng đã cho xung quanh trục đã chọn. Có nhiều phiên bản quickSort khác nhau chọn pivot theo những cách khác nhau.&nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:55:32 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983844886</guid>
      </item>
      <item>
         <title>Cài đặt thuật toán:</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983846922</link>
         <description><![CDATA[<div>#include&lt;stdio.h&gt;&nbsp;</div><div>void swap(int &amp;a, int &amp;b)</div><div>{</div><div>&nbsp; &nbsp; int t = a;</div><div>&nbsp; &nbsp; a = b;</div><div>&nbsp; &nbsp; b = t;</div><div>}</div><div>int partition (int arr[], int low, int high)</div><div>{</div><div>&nbsp; &nbsp; int pivot = arr[high];&nbsp; &nbsp; // pivot</div><div>&nbsp; &nbsp; int left = low;</div><div>&nbsp; &nbsp; int right = high - 1;</div><div>&nbsp; &nbsp; while(true){</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while(left &lt;= right &amp;&amp; arr[left] &lt; pivot) left++;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; while(right &gt;= left &amp;&amp; arr[right] &gt; pivot) right--;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; if (left &gt;= right) break;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; swap(arr[left], arr[right]);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; left++;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; right--;</div><div>&nbsp; &nbsp; }</div><div>&nbsp; &nbsp; swap(arr[left], arr[high]);</div><div>&nbsp; &nbsp; return left;</div><div>}</div><div>/* Hàm thực hiện giải thuật quick sort */</div><div>void quickSort(int arr[], int low, int high)</div><div>{</div><div>&nbsp; &nbsp; if (low &lt; high)</div><div>&nbsp; &nbsp; {</div><div>&nbsp; &nbsp; &nbsp; &nbsp; /* pi là chỉ số nơi phần tử này đã đứng đúng vị trí</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;và là phần tử chia mảng làm 2 mảng con trái &amp; phải */</div><div>&nbsp; &nbsp; &nbsp; &nbsp; int pi = partition(arr, low, high);</div><div>&nbsp;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; // Gọi đệ quy sắp xếp 2 mảng con trái và phải</div><div>&nbsp; &nbsp; &nbsp; &nbsp; quickSort(arr, low, pi - 1);</div><div>&nbsp; &nbsp; &nbsp; &nbsp; quickSort(arr, pi + 1, high);</div><div>&nbsp; &nbsp; }</div><div>}</div><div>/* Hàm xuất mảng */</div><div>void printArray(int arr[], int size)</div><div>{</div><div>&nbsp; &nbsp; int i;</div><div>&nbsp; &nbsp; for (i=0; i &lt; size; i++)</div><div>&nbsp; &nbsp; &nbsp; &nbsp; printf("%d ", arr[i]);</div><div>&nbsp; &nbsp; printf("\n");</div><div>}</div><div>main()</div><div>{</div><div>&nbsp; &nbsp; int arr[] = {10, 80, 30, 90, 40, 50, 70};</div><div>&nbsp; &nbsp; int n = sizeof(arr)/sizeof(arr[0]);</div><div>&nbsp; &nbsp; quickSort(arr, 0, n-1);</div><div>&nbsp; &nbsp; printf("Sorted array: \n");</div><div>&nbsp; &nbsp; printArray(arr, n);</div><div>&nbsp; &nbsp; return 0;</div><div>}&nbsp;</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:56:20 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983846922</guid>
      </item>
      <item>
         <title>Giải Thích Thuật toán</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983847455</link>
         <description><![CDATA[<div>Trong phần này chúng ta có hai giai đoạn. Giai đoạn một là giai đoạn phân đoạn mảng và giai đoạn hai là giai đoạn sắp xếp .<br><br>    Chọn pivot cho mảng, ở đây mình sẽ chọn pivot là số cuối cùng của mảng.<br>    Tạo hai biến là left và right để trỏ tới bên trái và bên phải của danh sách.<br>    Thực hiện so sánh các phần tử với pivot. Nếu phần tử nhỏ hơn pivot thì dịch chuyển qua bên trái và ngược lại.<br>    Sau khi dịch chuyển thực hiện công việc sắp xếp các phần tử trong mảng con mới, trước khi tiếp tục phân đoạn tiếp theo.</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:56:35 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983847455</guid>
      </item>
      <item>
         <title>Minh Họa</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983847964</link>
         <description><![CDATA[<div>VDMH: Cho dãy số có số phần tử n=5: <strong>10 5 7 3 1 4</strong> <strong><br>Pivot= 4</strong></div><div>Left= 0, Right=4</div><div>1&nbsp; 5&nbsp; 7&nbsp; 3&nbsp; 10&nbsp; 4</div><div>Left= 1, Right=3</div><div>1&nbsp; 3&nbsp; 7&nbsp; 5&nbsp; 10&nbsp; 4</div><div>Left= 2, Right=1</div><div>1&nbsp; 3&nbsp; 4&nbsp; 5&nbsp; 10&nbsp; 7</div><div><strong>Pivot= 3</strong></div><div>Left= 1, Right=0</div><div>1&nbsp; 3&nbsp; 4&nbsp; 5&nbsp; 10&nbsp; 7</div><div><strong>Pivot= 7</strong></div><div>Left= 4, Right=3<br>1&nbsp; 3&nbsp; 4&nbsp; 5&nbsp; 7&nbsp; 10<br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1251431383/260a63962a2b25a1cca68a79e4ab6e16/sx_nhanh.gif" />
         <pubDate>2022-01-10 13:56:49 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983847964</guid>
      </item>
      <item>
         <title>Nhận xét</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983849033</link>
         <description><![CDATA[<div>Ưu điểm</div><ul><li>Tốc độ sắp xếp nhanh.</li><li>Được sử dụng trong nhiều thư viện của các ngôn ngữ như C++, Java, ...</li></ul><div>Nhược điểm</div><ul><li>Phụ thuộc vào cách chọn phần tử chốt.</li><li>Không ổn định.</li></ul><div>Nhận xét</div><div>        So với sắp xếp nổi bọt thì sắp xếp nhanh mỗi lần đổi chỗ mang tính nhảy vọt. Từng lượt ta chọn một phần tử chốt, đem những số nhỏ hơn nó đặt bên trái nó, những số lớn hơn nó đặt bên phải phải. Dẫn đến số lượt đổi chỗ được ít hơn so với sự đổi chỗ từng cặp của sắp xếp nổi bọt.&nbsp;</div><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 13:57:15 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983849033</guid>
      </item>
      <item>
         <title>Định nghĩa chuỗi</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983861583</link>
         <description><![CDATA[<div>Chuỗi là một mảng một chiều mà các phần tử là các ký tự</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 14:02:21 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983861583</guid>
      </item>
      <item>
         <title>Các vấn đề liên quan tới chuỗi</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983863809</link>
         <description><![CDATA[<ul><li>Tìm một ký tự trong chuỗi</li><li>Đếm số ký tự trong chuỗi</li><li>Tìm một chuỗi con trong một chuỗi</li><li>Đảo ngược chuỗi</li><li>Tách chuỗi</li></ul><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 14:03:16 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983863809</guid>
      </item>
      <item>
         <title>Xử lý chuỗi</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983866031</link>
         <description><![CDATA[<div>Đầu vào<strong>:</strong> chuỗi 1 (s1), chuỗi 2 (s2)<br>Đầu ra<strong>:</strong> vị trí xuất hiện đầu tiên của chuỗi 2 trong chuỗi 1</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 14:04:15 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983866031</guid>
      </item>
      <item>
         <title>Mô tả </title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983867522</link>
         <description><![CDATA[<div>1/ So sánh chuỗi s2 với phần tử đầu chuỗi s1.<br>2/ Nếu không giống nhau thì dịch đến phần tử tiếp theo của chuỗi s1<br>3/ Đến khi đã tìm chuỗi s1 có trong chuỗi s2 thì dừng '\0'</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 14:04:51 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983867522</guid>
      </item>
      <item>
         <title>Cài đặt thuật toán</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983867798</link>
         <description><![CDATA[<div>#include &lt;stdio.h&gt;<br>#include &lt;conio.h&gt;<br>#include &lt;string.h&gt;<br>&nbsp;<br>int findsubstr(const char *str, char *sub)<br>{<br>&nbsp; &nbsp; const char *p = str;<br>&nbsp; &nbsp; int len = strlen(sub);<br>&nbsp; &nbsp; while(*p != NULL)<br>&nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; if (strlen(p) &gt;= len)<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (strncmp(p, sub, strlen(sub)) == 0)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; return (p - str + 1);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; else<br>&nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; break;<br>&nbsp; &nbsp; &nbsp; &nbsp; }<br>&nbsp; &nbsp; &nbsp; &nbsp; p++;<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; return 0;<br>}<br>&nbsp;<br>main()<br>{<br>&nbsp; &nbsp; char str[] = "vncoding.net blog for developer";<br>&nbsp; &nbsp; char sub1[] = "blog";<br>&nbsp; &nbsp; printf("str = '%s'\n", str);<br>&nbsp; &nbsp; printf("'%s' at %d\n", sub1, findsubstr(str, sub1));<br>&nbsp; &nbsp; getch();<br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 14:04:58 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983867798</guid>
      </item>
      <item>
         <title>Hướng dẫn</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983873289</link>
         <description><![CDATA[<div><br></div><ul><li>Viết một hàm nhận ký tự cần đếm và vị trí của ký tự đó. Ví dụ countChar(String s, char c, int i)</li><li>Trong đó:<ul><li>– Lặp từ 0 -&gt; đến i-1 nếu ký tự đó đã xuất hiện thì thoát khỏi hàm (đã đếm rồi).</li><li>– Lặp từ i đến cuối chuỗi, đến số lần xuất hiện của ký tự đó</li><li>– In ký tự đó ra theo dạng c-count</li></ul></li><li>Trong hàm main cho lặp từ đầu đến cuối chuỗi và gọi hàm countChar ở trên để đếm và in ra.</li></ul><div><br>&nbsp;<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-10 14:07:16 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983873289</guid>
      </item>
      <item>
         <title>Mô tả thuật toán</title>
         <author>chuongnguyendn02</author>
         <link>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983877658</link>
         <description><![CDATA[<div>Bước 1: Lấy phần tử chốt là phần tử ở cuối danh sách.</div><div>Bước 2: Chia mảng theo phần tử chốt.</div><div>Bước 3: Sử dụng sắp xếp nhanh một cách đệ qui với mảng con bên trái.</div><div>Bước 4: Sử dụng sắp xếp nhanh một cách đệ qui với mảng con bên phải.</div><div><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/1251431383/ccb1bedbfbbe03ecd0755dbc22c86d70/A_nh_chu_p_ma_n_hi_nh_2022_01_10_211626.gif" />
         <pubDate>2022-01-10 14:09:01 UTC</pubDate>
         <guid>https://padlet.com/chuongnguyendn02/BTnhomcuoiky/wish/1983877658</guid>
      </item>
   </channel>
</rss>
