Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 7

PART-A PLAN

1.0 Brief Introduction


____________________________________________________
In this Micro project our group has made a program to Sort Elements Of The Array Using Quick
Sort Algorithm.

2.0 AIM of Micro-Project


____________________________________________________
.
Main aim of this micro project is to create a program to Sort Elements Of The Array Using
By Quick Sort Algorithm.

3.0 Action Plan


____________________________________________________
Sr. Details of Activity Planned Planned Name of Responsible
No Start Date Finish Date Team Members

1 Project selection 1/12/21 7/12/21 Arpan P,Dhiraj C,

2 Identifying project outcomes 7/12/18 8/12/21 Anish D,Dhiraj C,


3 Identifying resources required 8/12/21 9/12/21 Dhiraj C,Anish D,Cain D.

4 Algorithm & implementation 9/12/21 10/12/21 Anish D, Dhiraj C.

5 Final outcome 10/12/21 11/12/21 Dhiraj C,.Arpan P,Cain D,

6 Documentation 11/12/21 12/12/21 Dhiraj C,Sarth G, Cain D.

7 Seminer and viva-vose 12/21/18 17/12/21 Sarth G, Dhiraj C,Cain D

8 Final submission of 17/12/21 18/12/21 Dhiraj C,


Microproject

4.0 Resources Required


____________________________________________________

Sr. No Name of Resource Specification Qty Remarks

1 Computer 500GB HDD, 1


4 Gb RAM,
AMD processor,
Windows 7 OS
2 Turbo C Yes 1
PART-B OUTCOME
1.0 Brief Description
____________________________________________________
Quick sort is the fastest internal sorting algorithm with the time complexity O (n log n). The
basic algorithm to sort an array a[ ] of n elements can be described recursively .Quick sort is also
based on the 'Divide & Conquer' algorithm. In this sorting technique, an element is picked as a
pivot and the array is partitioned around the pivot element. The target of each partition is, to put
all smaller elements before pivot & put all greater elements after the pivot. This process is
completed in linear time.

2.0 AIM of Micro-Project


____________________________________________________
Main aim of this micro project is to create a program to Sort Elements Of The Array Using By
Quick Sort Algorithm.
3.0 Course Outcomes (CO)
c. Sort Elements Of The Array Using Quick Sort Algorithm.

4.0 Procedure Followed

Algorithm

Step 1: If n < = 1, then return.


Step 2: Pick any element V in a[]. This is called the pivot.
Step 3 Rearrange elements of the array by moving all elements xi > V right of V and all elements
xi < = V left of V. If the place of the V after re-arrangement is j, all elements with value less than
V, appear in a[0], a[1] . . . . a[j – 1] and all those with value greater than V appear in a[j + 1] . . . .
a[n – 1].
Step 4: Apply quick sort recursively to a[0] . . . . a[j – 1] and to a[j + 1] . . . . a[n –1]..
Flow Chart

5.0 Resources Used


____________________________________________________
Sr. No Name of Resource Specification Qty Remarks

1 Computer 500GB HDD, 1


4 Gb RAM,
AMD processor,
Windows 7 OS
2 Turbo C Turbo C7 1

6.0 Outputs of Micro-Projects


____________________________________________________
C Code
#include<stdio.h>
void quicksort(int x[20],int first,int last)
{
int pivot,j,temp,i;
if(first<last)
{
pivot=first;
i=first;
j=last;

while(i<j)
{
while(x[i]<=x[pivot]&&i<last)
i++;
while(x[j]>x[pivot])
j--;
if(i<j)
{
temp=x[i];
x[i]=x[j];
x[j]=temp;
}
}
temp=x[pivot];
x[pivot]=x[j];
x[j]=temp;
quicksort(x,first,j-1);
quicksort(x,j+1,last);
}
}
int main()
{
int x[20],size,i;
printf("\tQuick sort\n");
printf("-----------------------------------\n");
printf(" How many numbers you want to sort?: ");
scanf("%d",&size);
printf("\n Enter %d elements: \n",size);
for(i=0;i<size;i++)
scanf("%d",&x[i]);
quicksort(x,0,size-1);
printf("\n Sorted elements after applying quick sort: \n\n");
for(i=0;i<size;i++)
printf(" %d",x[i]);
return 0;
}

7.0 Skill Developed


_____________________________________________________________________________________
Thus, we have studied how to Sort Elements Of The Array Using Quick Sort Algorithm.

You might also like