Delivered by FeedBurner

New Answers in your Inbox

CS-62 JUNE 2003 QNO 6(a)

Q.Write a recursive algorithm to implement Quick Sort.

Ans. The Quick Sort can be implemeted efficiently using recursion. The Base case may be when low is greater than or equal to high.

The function/algo is as follows:

quick(a, low, high)
int a[], low, high
{
if (low>=high)
return;
partition (a, low, high, pos);
quick(a.low, pos-1);
quick(a.pos_1, high);
}

New website for IGNOU BCA MCA student

New website for IGNOU BCA MCA student

MCA-BCA-IGNOU