0% found this document useful (0 votes)
8 views1 page

Hindol Kumar Samanta

Uploaded by

rremo9705
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views1 page

Hindol Kumar Samanta

Uploaded by

rremo9705
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

#include <stdio.

h>

void swap(int arr], int i, int i) t


int temp =arrli:
arrli] = arrlj):
arrlj] = temp:

int partition(int arr[], int first, int last) {


int pivot =last, i= first - 1, j= first:
for (: j<lasti jt+) {
if(arrlj] <arrlpivot) {
it+;
Swaplarr, i, j);

swaplarr, i+1, pivot);


return i+1;

void quicksort(int arr[], int first, int last) {


if (first < last) {
int k = partitionlarr, first, last);
quicksortlarr, first, k - 1);
quicksortlarr, k +1, last);

int main)
int n;

printf("Enter The Size of Arrdy: ");


scanf("%d", &n);

int arrln];

for (int i= 0; i< n; it+){


printf("\nEnter The Element: ");
scanf("%d', &arrli);

printf("\nArray Elements Before Sorting:\n");


for (int i= 0;i<n; it+){
printf("\t%d", arrliD);

quicksortlarr, O, n - 1);

printf("nArray Elements After Sorting:\n);


for (int i= 0; i< n; i++){
printf("\t%d", arrliD):

return 0;

redlme Notes

You might also like