Share with others

Implement Quick sort using recursion
#include
#include
void quick_sort(int [],int,int);
int partition(int [],int,int);
void main()
{
int a[30],n,i,op;
clrscr();
do
{
printf(“\n1)Quick Sort\n2)Quit”);
printf(“\nEnter your choice : “);
scanf(“%d”,&op);
if(op==1)
{
printf(“\nEnter no of elements :”);
scanf(“%d”,&n);
printf(“\nEnter array elements :”);
for(i=0;i<=u); 

do
{ j–;
}while(a[j]>v);

if(i)>;i++)>

Output

1)Quick Sort
2)Quit
Enter your choice : 1

Enter no of elements :6

Enter array elements :60 33 70 84 21 50

Sorted array is :21 33 50 60 70 84
1)Quick Sort
2)Quit
Enter your choice : 2

);>)>)>;i++)>


Share with others