<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.ta.in.th/index.php?action=history&amp;feed=atom&amp;title=Quicksort</id>
	<title>Quicksort - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.ta.in.th/index.php?action=history&amp;feed=atom&amp;title=Quicksort"/>
	<link rel="alternate" type="text/html" href="https://wiki.ta.in.th/index.php?title=Quicksort&amp;action=history"/>
	<updated>2026-05-02T17:15:05Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.33.0-alpha</generator>
	<entry>
		<id>https://wiki.ta.in.th/index.php?title=Quicksort&amp;diff=52&amp;oldid=prev</id>
		<title>Tata: Created page with &quot;&lt;pre&gt; #include&lt;stdio.h&gt; int n,seq[100000];  void swap(int x,int y){     int temp=seq[x];     seq[x]=seq[y];     seq[y]=temp; }  void quick(int lb,int ub){     if(lb&gt;=ub) retur...&quot;</title>
		<link rel="alternate" type="text/html" href="https://wiki.ta.in.th/index.php?title=Quicksort&amp;diff=52&amp;oldid=prev"/>
		<updated>2019-03-07T17:00:25Z</updated>

		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;lt;pre&amp;gt; #include&amp;lt;stdio.h&amp;gt; int n,seq[100000];  void swap(int x,int y){     int temp=seq[x];     seq[x]=seq[y];     seq[y]=temp; }  void quick(int lb,int ub){     if(lb&amp;gt;=ub) retur...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;pre&amp;gt;&lt;br /&gt;
#include&amp;lt;stdio.h&amp;gt;&lt;br /&gt;
int n,seq[100000];&lt;br /&gt;
&lt;br /&gt;
void swap(int x,int y){&lt;br /&gt;
    int temp=seq[x];&lt;br /&gt;
    seq[x]=seq[y];&lt;br /&gt;
    seq[y]=temp;&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
void quick(int lb,int ub){&lt;br /&gt;
    if(lb&amp;gt;=ub) return;&lt;br /&gt;
    int piv=seq[lb],back=lb,i;&lt;br /&gt;
    for(i=lb+1;i&amp;lt;=ub;i++){&lt;br /&gt;
        if(seq[i]&amp;lt;piv){&lt;br /&gt;
            back++;&lt;br /&gt;
            swap(back,i);&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
    swap(back,lb);&lt;br /&gt;
    quick(lb,back-1);&lt;br /&gt;
    quick(back+1,ub);&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
int main(){&lt;br /&gt;
    printf(&amp;quot;Enter numbers of input : &amp;quot;);&lt;br /&gt;
    scanf(&amp;quot;%d&amp;quot;,&amp;amp;n);&lt;br /&gt;
    int i;&lt;br /&gt;
    printf(&amp;quot;Enter %d numbers : &amp;quot;,n);&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        scanf(&amp;quot;%d&amp;quot;,&amp;amp;seq[i]);&lt;br /&gt;
    }&lt;br /&gt;
&lt;br /&gt;
    quick(0,n-1);&lt;br /&gt;
&lt;br /&gt;
    printf(&amp;quot;\nSorted sequence is : &amp;quot;);&lt;br /&gt;
    for(i=0;i&amp;lt;n;i++){&lt;br /&gt;
        printf(&amp;quot;%d &amp;quot;,seq[i]);&lt;br /&gt;
    }&lt;br /&gt;
    &lt;br /&gt;
    scanf(&amp;quot; &amp;quot;);&lt;br /&gt;
    return 0;&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Tata</name></author>
		
	</entry>
</feed>