Implementing Quicksort Algorithm in Java

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

public class QuickSort
static protected int a[];
public static void main(String args[])throws IOException
BufferedReader obj= new BufferedReader (new InputStreamReader (;
int n,low,mid,high;
System.out.println(“Enter number of elements:”);
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 *

This site uses Akismet to reduce spam. Learn how your comment data is processed.