<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Quick sort | Student Projects</title>
	<atom:link href="https://studentprojects.in/tag/quick-sort/feed/" rel="self" type="application/rss+xml" />
	<link>https://studentprojects.in</link>
	<description>Microcontroller projects, Circuit Diagrams, Project Ideas</description>
	<lastBuildDate>Thu, 27 Jan 2011 13:38:31 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.1.7</generator>
	<item>
		<title>C++ program to implement Quick sort Algorithm using class</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-implement-quick-sort-algorithm-using-class/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-implement-quick-sort-algorithm-using-class/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Tue, 01 Feb 2011 13:35:44 +0000</pubDate>
				<category><![CDATA[Basic Programs]]></category>
		<category><![CDATA[Source Codes]]></category>
		<category><![CDATA[C Programs]]></category>
		<category><![CDATA[download]]></category>
		<category><![CDATA[class]]></category>
		<category><![CDATA[array]]></category>
		<category><![CDATA[Quick sort]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1238</guid>

					<description><![CDATA[<p>#include const int MAX = 10 ; class array { private : int arr[MAX] ; int count ; public : array( ) ; void add ( int item ) ; int getcount( ) ; static int split ( int *, int, int ) ; void quiksort ( int lower, int upper ) ; void display(</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-implement-quick-sort-algorithm-using-class/">C++ program to implement Quick sort Algorithm using class</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<pre lang="cpp">
#include <iostream.h>
const int MAX = 10 ;
class array
{
	private :

		int arr[MAX] ;
		int count ;
	public :

		array( ) ;
		void add ( int item ) ;
		int getcount( ) ;
		static int split ( int *, int, int ) ;
		void quiksort ( int lower, int upper ) ;
		void display( ) ;
} ;
array :: array( )
{
	count = 0 ;
	for ( int i = 0 ; i < MAX ; i++ )
		arr[i] = 0 ;
}
void array :: add ( int item )
{
	if ( count < MAX )
	{
		arr[count] = item ;
		count++ ;
	}
	else
		cout << "\nArray is full" << endl ;
}
int array :: getcount( )
{
	return count ;
}
void array :: quiksort ( int lower, int upper )
{
	if ( upper > lower )
	{
		int i = split ( arr, lower, upper ) ;
		quiksort ( lower, i - 1 ) ;
		quiksort ( i + 1, upper ) ;
	}
}
int array :: split ( int *a, int lower, int upper )
{
	int i, p, q, t ;

	p = lower + 1 ;
	q = upper ;
	i = a[lower] ;
	while ( q >= p )
	{
		while ( a[p] < i )
			p++ ;
		while ( a[q] > i )
			q-- ;
		if ( q > p )
		{
			t = a[p] ;
			a[p] = a[q] ;
			a[q] = t ;
		}
	}
	t = a[lower] ;
	a[lower] = a[q] ;
	a[q] = t ;
	return q ;
}
void array :: display( )
{
	for ( int i = 0 ; i < count ; i++ )
		cout << arr[i] << "  " ;
	cout << endl ;
}
void main( )
{
	array a ;
	a.add ( 11 ) ;
	a.add ( 2 ) ;
	a.add ( 9 ) ;
	a.add ( 13 ) ;
	a.add ( 57 ) ;
	a.add ( 25 ) ;
	a.add ( 17 ) ;
	a.add ( 1 ) ;
	a.add ( 90 ) ;
	a.add ( 3 ) ;
	cout << "\nQuik sort.\n" ;
	cout << "\nArray before sorting:" << endl ;
	a.display( ) ;
	int c = a.getcount( ) ;
	a.quiksort ( 0, c - 1 ) ;
	cout << "\nArray after quick sorting:" << endl ;
	a.display( ) ;
}
</pre><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-implement-quick-sort-algorithm-using-class/">C++ program to implement Quick sort Algorithm using class</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-program-to-implement-quick-sort-algorithm-using-class/feed/</wfw:commentRss>
			<slash:comments>10</slash:comments>
		
		
			</item>
		<item>
		<title>C++ programs for sorting numbers in ascending order using Quick sort method</title>
		<link>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-programs-for-sorting-numbers-in-ascending-order-using-quick-sort-method/</link>
					<comments>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-programs-for-sorting-numbers-in-ascending-order-using-quick-sort-method/#comments</comments>
		
		<dc:creator><![CDATA[Editorial Team]]></dc:creator>
		<pubDate>Thu, 11 Mar 2010 17:27:51 +0000</pubDate>
				<category><![CDATA[Basic Programs]]></category>
		<category><![CDATA[programs]]></category>
		<category><![CDATA[sorting numbers]]></category>
		<category><![CDATA[cpp]]></category>
		<category><![CDATA[Quick sort]]></category>
		<guid isPermaLink="false">http://studentprojects.in/?p=1035</guid>

					<description><![CDATA[<p>/* Write C++ programs for sorting a given list of elements in ascending order using Quick sort sorting methods */ #include #include int a[10],l,u,i,j; void quick(int *,int,int); void main() { clrscr(); cout</p>
<p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-programs-for-sorting-numbers-in-ascending-order-using-quick-sort-method/">C++ programs for sorting numbers in ascending order using Quick sort method</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></description>
										<content:encoded><![CDATA[<p>/* Write C++ programs for sorting a given list of elements in ascending order using Quick sort sorting methods */</p>
<pre lang="cpp">
#include<iostream.h>
#include<conio.h>
int a[10],l,u,i,j;
void quick(int *,int,int);
void main()
{
clrscr();
cout <<"enter 10 elements";
for(i=0;i<10;i++)
cin >> a[i];
l=0;
u=9;
quick(a,l,u);
cout <<"sorted elements";
for(i=0;i<10;i++)
cout << a[i] << " ";
getch();
}

void quick(int a[],int l,int u)
{
   int p,temp;
   if(l<u)
   {
   p=a[l];
   i=l;
   j=u;
    while(i<j)
   {
      while(a[i] <= p &#038;&#038; i<j )
	 i++;
      while(a[j]>p && i<=j )
	   j--;
      if(i<=j)
      {
      temp=a[i];
      a[i]=a[j];
      a[j]=temp;}
  }
  temp=a[j];
  a[j]=a[l];
  a[l]=temp;
  cout <<"\n";
  for(i=0;i<10;i++)
  cout <<a[i]<<" ";
  quick(a,l,j-1);
  quick(a,j+1,u); 
 }
}
</pre>
<p><strong>OUTPUT</strong></p>
<p>enter 10 elements5 2 3 16 25 1 20 7 8 61 14</p>
<p>1 2 3 5 25 16 20 7 8 61<br />
1 2 3 5 25 16 20 7 8 61<br />
1 2 3 5 25 16 20 7 8 61<br />
1 2 3 5 25 16 20 7 8 61<br />
1 2 3 5 25 16 20 7 8 61<br />
1 2 3 5 8 16 20 7 25 61<br />
1 2 3 5 7 8 20 16 25 61<br />
1 2 3 5 7 8 16 20 25 61<br />
1 2 3 5 7 8 16 20 25 61 </p>
<p>sorted elements1 2 3 5 7 8 16 20 25 61</p><p>The post <a href="https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-programs-for-sorting-numbers-in-ascending-order-using-quick-sort-method/">C++ programs for sorting numbers in ascending order using Quick sort method</a> first appeared on <a href="https://studentprojects.in">Student Projects</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://studentprojects.in/software-development/cpp/cpp-programs/cpp-basic/c-programs-for-sorting-numbers-in-ascending-order-using-quick-sort-method/feed/</wfw:commentRss>
			<slash:comments>23</slash:comments>
		
		
			</item>
	</channel>
</rss>
