<?xml version="1.0"?>
<rss version="2.0">
   <channel>
      <title>Nhóm 8 - Thuật toán sắp xếp nhanh (Quick Sort) by Phương Vy</title>
      <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp</link>
      <description>Cấu trúc dữ liệu và giải thuật</description>
      <language>en-us</language>
      <pubDate>2021-12-31 02:17:43 UTC</pubDate>
      <lastBuildDate>2024-02-21 04:20:16 UTC</lastBuildDate>
      <webMaster>hello@padlet.com</webMaster>
      <image>
         <url>https://padlet.net/icons/png/1f4f6.png</url>
      </image>
      <item>
         <title>Chọn phần tử cuối làm chốt</title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969346569</link>
         <description><![CDATA[<div>#include&lt;stdio.h&gt;<br>void nhap(int a[], int &amp;n){<br>	int i;<br>	printf("Nhap so luong phan tu: ");<br>	scanf("%d",&amp;n);<br>	for(i=1;i&lt;=n;i++)<br>		{<br>			printf("Phan tu %d: ",i);<br>			scanf("%d",&amp;a[i]);<br>		}<br>}<br><br>void in(int a[],int dau, int cuoi)<br>{<br>	int i;<br>	for(i=dau;i&lt;=cuoi;i++)<br>		printf(" %d ",a[i]);<br>}<br><br>void hoanvi(int &amp;a, int &amp;b){<br>	int tg;<br>	tg=a;<br>	a=b;<br>	b=tg;<br>}<br><br>int vitri_chot(int a[], int dau, int cuoi){<br>	int chot, trai, phai;<br>	chot=a[cuoi];<br>	trai=dau;<br>	phai=cuoi-1;<br>	while(true){<br>		while(trai&lt;=phai&amp;&amp;a[trai]&lt;chot)<br>			trai++;<br>		while(phai&gt;=trai&amp;&amp;a[phai]&gt;chot)<br>			phai--;<br>		if(trai&gt;phai)<br>			break;<br>		hoanvi(a[trai],a[phai]);<br>		trai++;<br>		phai--;<br>	}<br>	hoanvi(a[trai],a[cuoi]);		<br>	return trai;<br>}<br><br>void quickSort_cuoi(int a[], int dau, int cuoi){<br>	int vt;<br>	if(dau&lt;cuoi)<br>		{<br>			printf("\nVT=%d Trai=%d Phai=%d :" ,cuoi ,dau ,cuoi-1);<br>			in(a,dau,cuoi);<br>			vt=vitri_chot(a,dau,cuoi);<br>			quickSort_cuoi(a,dau,vt-1);<br>			quickSort_cuoi(a,vt+1,cuoi);<br>		}<br>}<br>main(){<br>	int ds[100], spt, x;<br>&nbsp; &nbsp; nhap(ds,spt);<br>&nbsp; &nbsp; printf("Day so:&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ");<br>&nbsp; &nbsp; in(ds,1,spt);<br>	quickSort_cuoi(ds,1,spt);<br>	printf("\nDay so sau khi sap xep: \n");<br>	in(ds,1,spt);<br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 02:36:22 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969346569</guid>
      </item>
      <item>
         <title>Chọn phần tử cuối mảng làm chốt</title>
         <author>dangtu9520</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969348604</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/925585533/d4302971f4c2437a4aeed365e72b75ea/image.png" />
         <pubDate>2021-12-31 02:38:22 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969348604</guid>
      </item>
      <item>
         <title>Đặng Văn Hoài Tú</title>
         <author>dangtu9520</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969348895</link>
         <description><![CDATA[<div>- Các cách chọn phần tử chốt<br>- Minh họa thuật toán (hình ảnh)<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 02:38:40 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969348895</guid>
      </item>
      <item>
         <title>Ngô Hồng Phương Vy</title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969349031</link>
         <description><![CDATA[<div>- Đầu vào, đầu ra<br>- Mô tả thuật toán<br>- Minh họa thuật toán (văn bản)<br>- Cài đặt thuật toán: chọn phần tử cuối làm chốt<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 02:38:48 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969349031</guid>
      </item>
      <item>
         <title>Trần Đình Việt</title>
         <author>2050531200357</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969350136</link>
         <description><![CDATA[<div>- Cài đặt thuật toán: chọn phần tử đầu làm chốt</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 02:39:55 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969350136</guid>
      </item>
      <item>
         <title></title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969405160</link>
         <description><![CDATA[<div>- Đầu vào: Dãy số (a), số phần tử (n)<br>- Đầu ra: Dãy số tăng dần<em><br></em><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 03:42:27 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969405160</guid>
      </item>
      <item>
         <title>Nguyễn Văn Khoa</title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969405335</link>
         <description><![CDATA[<div>- Cài đặt thuật toán: chọn phần tử giữa làm chốt</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 03:42:44 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969405335</guid>
      </item>
      <item>
         <title>Chọn phần tử đầu làm chốt</title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969407492</link>
         <description><![CDATA[<div>#include&lt;stdio.h&gt;<br>void nhap(int a[], int &amp;n){<br>	int i;<br>	printf("nhap so luong phan tu: ");<br>	scanf("%d",&amp;n);<br>	for(i=1;i&lt;=n;i++)<br>		{<br>			printf("a[%d] = ",i);<br>			scanf("%d",&amp;a[i]);<br>		}<br>}<br>void in(int a[], int n){<br>	int i;<br>	for(i=1;i&lt;=n;i++)<br>		printf("%d ",a[i]);<br>}<br>void hoanvi(int &amp;a, int &amp;b){<br>	int tg;<br>	tg=a;<br>	a=b;<br>	b=tg;<br>}<br>int layvitri(int a[], int dau, int cuoi){<br>	int trai, phai, chot;<br>	chot=dau;<br>	trai=dau;<br>	phai=cuoi;<br>&nbsp; &nbsp; while(trai&lt;phai){<br>&nbsp; &nbsp; &nbsp; &nbsp; while(a[trai]&lt;=a[chot] &amp;&amp; trai &lt; cuoi)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 	trai++;<br>&nbsp; &nbsp; &nbsp; &nbsp; while( a[phai]&gt;a[chot] )<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; phai-- ;<br>&nbsp; &nbsp; &nbsp; &nbsp; if(trai&lt;phai)<br>&nbsp; &nbsp; &nbsp; &nbsp; 	hoanvi(a[trai],a[phai]);<br>&nbsp; &nbsp; }<br>&nbsp; &nbsp; hoanvi(a[chot],a[phai]);<br>&nbsp; &nbsp; return phai;<br>}<br>void quicksort_dau(int a[],int dau,int cuoi){<br>	int vt;<br>	if(dau&lt;cuoi){<br>&nbsp; &nbsp; 	vt = layvitri(a,dau,cuoi);<br>&nbsp; &nbsp; 	quicksort_dau(a,dau,vt-1);<br>&nbsp; &nbsp; 	quicksort_dau(a,vt+1,cuoi);<br>	}<br>}<br>main(){<br>	int a[100], n, x;<br>	nhap(a,n);<br>	quicksort_dau(a,1,n);<br>	printf("day sau khi sap xep: ");<br>	in(a,n);	<br>}</div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 03:46:05 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969407492</guid>
      </item>
      <item>
         <title>Chọn phàn tử giữa làm chốt</title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969407763</link>
         <description><![CDATA[<div>#include&lt;stdio.h&gt;<br><br>void Nhap_mang(int ds[],int n)<br>{<br>	int i;<br>	for(i=1;i&lt;=n;i++)<br>	{<br>		printf("Nhap phan tu thu %d: ",i);<br>		scanf("%d", &amp;ds[i]);<br>	}<br>}<br><br>void In(int ds[],int n)<br>{<br>	int i;<br>	for(i=1;i&lt;=n;i++)<br>		printf("%d\t",ds[i]);<br>}<br><br>void quickSort_giua(int ds[], int l , int r)<br>{<br>	int tg;<br>	if (l &lt;= r)<br>	{<br>		int key = ds[(l+r)/2];<br>		int i = l;<br>		int j = r;<br><br>		while (i &lt;= j)<br>		{<br>			while (ds[i] &lt; key)<br>				i++;<br>			while (ds[j] &gt; key)<br>				j--;<br>			if (i &lt;= j)<br>			{<br>				tg = ds[i];<br>				ds[i] = ds[j];<br>				ds[j] = tg;<br>				i++;<br>				j--;<br>			}<br>		}<br>		if (l &lt; j)<br>			quickSort_giua(ds, l, j);<br>		if (r &gt; i)<br>			quickSort_giua(ds, i, r);<br>	}<br>}<br><br>main()<br>{<br>	int *ds,n;<br>	printf("Nhap so luong phan tu cho day so: ");<br>	scanf("%d",&amp;n);<br>	ds = new int [n+1];<br>	Nhap_mang(ds,n);<br>	In(ds,n);<br>	quickSort_giua(ds,1,n);<br>	printf("\n");<br>	In(ds,n);<br>}<br><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2021-12-31 03:46:20 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969407763</guid>
      </item>
      <item>
         <title>Chọn phần tử đầu mảng làm chốt</title>
         <author>dangtu9520</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969423987</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/925585533/f28cde7e6e814fd3b979250fbc9a9312/image.png" />
         <pubDate>2021-12-31 04:13:58 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1969423987</guid>
      </item>
      <item>
         <title>Chọn phần tử cuối làm chốt</title>
         <author>pvy21022002</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1972331681</link>
         <description><![CDATA[<ul><li>Dãy số : 5 80 12 90 32 50 71</li><li>Quá trình sắp xếp:</li><li>Lần 1: {5, 80, 12, 90, 32, 50, 71}</li><li>Lần 2: [{5, 12, 32, 50}&lt; 71 &lt;={90, 80}]</li><li>Lần 3: [{5,12, 32}&lt; 50 &lt;={∅}] [{∅}&lt; 80 &lt;={90}]</li><li>Lần 4: [{5, 12}&lt; 32 &lt;={∅}]</li><li>Lần 5: [{5}&lt; 12 &lt;={∅}]</li><li>Dãy số được sắp xếp: 5 12 32 50 71 80 90</li></ul><div><br></div>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-03 15:07:50 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1972331681</guid>
      </item>
      <item>
         <title>Chọn phần tử giữa mảng làm chốt</title>
         <author>dangtu9520</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1981399689</link>
         <description><![CDATA[]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/925585533/602877db86d6ce8e63e606d3fe94cf20/image.png" />
         <pubDate>2022-01-08 03:30:41 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1981399689</guid>
      </item>
      <item>
         <title></title>
         <author>dangtu9520</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1981405435</link>
         <description><![CDATA[<div>- Chọn phần tử chốt.<br>- Chia dãy số thành 2 dãy con:<br>&nbsp; &nbsp;+ Dãy con bên trái phần tử chốt (gồm những phần từ bé hơn hoặc bằng phần tử chốt)<br>&nbsp; &nbsp;+ Dãy con bên phải phần tử chốt (gồm những phần tử lớn hơn hoặc bằng phần tử chốt)<br>- Lặp lại thuật toán với 2 dãy con trái và phải<br>- Kết quả: Dãy số được sắp xếp tăng dần.</div><div><br><br></div>]]></description>
         <enclosure url="https://padlet-uploads.storage.googleapis.com/920166940/a866140346b97e979b221fe52a44ba27/3073763763579612080.mp4" />
         <pubDate>2022-01-08 03:41:20 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1981405435</guid>
      </item>
      <item>
         <title>Các cách chọn phần tử chốt</title>
         <author>dangtu9520</author>
         <link>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1981408158</link>
         <description><![CDATA[<div>Tốc độ sắp xếp của thuật toán tùy thuộc vào việc lựa chọn phần tử chốt, có một số cách chọn như sau:</div><ol><li>Chọn phần tử đầu tiên của mảng.</li><li>Chọn phần tử cuối cùng của mảng.</li><li>Chọn phần nằm giữa mảng.</li><li>Chọn Random một phần tử của mảng. (Thuật toán tương tự 3 cách chọn trên)</li></ol>]]></description>
         <enclosure url="" />
         <pubDate>2022-01-08 03:46:18 UTC</pubDate>
         <guid>https://padlet.com/pvy21022002/u0olb19z0rp9u1sp/wish/1981408158</guid>
      </item>
   </channel>
</rss>
