import java.util.*; class QuickSort11 // Destructive quick sort of a random array of integers // Done using a stack of from/to pairs rather than recursion { public static void main(String[] args) throws Exception { Random rand = new Random(); Scanner input = new Scanner(System.in); System.out.print("Enter the number of numbers: "); int num = input.nextInt(); System.out.print("Enter the highest number: "); int high = input.nextInt(); Integer[] a = new Integer[num]; for(int i=0; i stack = new ArrayList(); stack.add(new Pair(0,a.length)); while(stack.size()>0) { Pair p=stack.remove(stack.size()-1); int from=p.from; int to=p.to; if(to>from+1) { Integer pivot = a[from]; int low=from+1,high=to-1; while(low