Implementing Quicksort Algorithm in Java

Quicksort is a divide and conquer algorithm. Here is an another way to implement this algorithm in Java. 

import java.io.*;
public class QuickSort
{
static protected int a[];
public static void main(String args[])throws IOException
{
BufferedReader obj= new BufferedReader (new InputStreamReader (System.in));
int n,low,mid,high;
System.out.println(“Enter number of elements:”);
n=Integer.parseInt(obj.readLine());
a=new int[n];
System.out.println(“Enter elements”);
for (int i=0;i

Leave a Reply

Your email address will not be published. Required fields are marked *