QuickSort Random Real Number
<p>QuickSort Random Real Numbers Generate a random array of 150 numbers with your own custom randomizer. 1)Display the numbers in unsorted. 2)Start StopWatch and display time. 3)Use QuickSort to sort the array. 4)Stop the StopWatch and display how long it ran. 5)Display the numbers in sorted order ascending.</p>

<h2><em>Heres my random generator class</em></h2>

<pre><code>/**
*/
  class RandomGenerator
{
  public RandomGenerator()
{
}

public double randomLong(double shift)
{
  long x = System.nanoTime();
  x ^= (x &lt;&lt;(int)(shift/100)); 
  x ^= (x &gt;&gt;&gt;(int)(shift%10)); 
  x ^= (x &lt;&lt; (int)Math.sqrt(shift)); 
  if ((x&gt;0)||(x&lt;0))
{
  return x;
 }
  else
  return(randomLong(System.nanoTime()*Math.sqrt(System.nanoTime())));
 }
}
</code></pre>

<h2>Here is my quick sort class</h2>

<pre><code> public class QuickSort
 {
 public QuickSort()
{
 }
 public double[] sort(double[] a)
{
 sort(a, 0, a.length - 1);
 return(a);
}
 private void sort(double[] a, int from, int to)
{
 if (from &gt;= to){return; }
 int p = partition(a, from, to);
 sort(a, from, p);
 sort(a, p + 1, to);
 }
  private int partition(double[] a, int from, int to)
 {
  double pivot = a[from];
  int i = from - 1;
  int j = to + 1;
  while(i &lt; j)
  {
     i++; while (a[i] &lt; pivot) {i++;}
 j--; while (a[j] &gt; pivot) {j--;}
 if(i &lt; j)
 {
  double temp;
  temp = a[i];
  a[i] = a[j];
  a[j] = temp;
  }
    }
   return j;
   }
 }
</code></pre>

<h2>Here is my stopwatch class</h2>

<pre><code>/**
   A stopwatch accumulates time when it is running. You can 
   repeatedly start and stop the stopwatch. You can use a
   stopwatch to measure the running time of a program.
 */
     public class StopWatch
      {  
       private long elapsedTime;
       private long startTime;
       private boolean isRunning;

    /**
      Constructs a stopwatch that is in the stopped state
      and has no time accumulated.
   */
   public StopWatch()
{  
   reset();
}

 /**
  Starts the stopwatch. Time starts accumulating now.
 */
 public void start()
{  
   if (isRunning) { return; }
   isRunning = true;
   startTime = System.currentTimeMillis();
}

/**
   Stops the stopwatch. Time stops accumulating and is
   is added to the elapsed time.
*/
public void stop()
{  
   if (!isRunning) { return; }
   isRunning = false;
   long endTime = System.currentTimeMillis();
   elapsedTime = elapsedTime + endTime - startTime;
}

 /**
   Returns the total elapsed time.
   @return the total elapsed time
 */
public long getElapsedTime()
{  
   if (isRunning) 
   {  
      long endTime = System.currentTimeMillis();
      return elapsedTime + endTime - startTime;
   }
   else
   {
      return elapsedTime;
   }
}

/**
   Stops the watch and resets the elapsed time to 0.
*/
public void reset()
{  
   elapsedTime = 0;
   isRunning = false;
 }
</code></pre>

<p>}</p>

<h2>Here is my viewer class or main method (this I really need help on)</h2>

<pre><code> public class QsortViewer
 {
 private static final int MAX_ELEMENTS=150; 
 public static void main(String[] args)
 {
  RandomGenerator RG = new RandomGenerator();
  QuickSort QS = new QuickSort();
  StopWatch SW = new StopWatch();

 double[] numbers = new double[MAX_ELEMENTS];

 for (int i = 0; i &lt;= numbers.length-1; i++)
{
 numbers[i] = RG.randomLong(i*i*Math.sqrt(i)*Math.pow(i,i));
  }
  }
}
</code></pre>

<p>All my classes are correct, all i need help with is 1)Display the numbers in unsorted. 2)Start StopWatch and display time. 3)Use QuickSort to sort the array. 4)Stop the StopWatch and display how long it ran. 5)Display the numbers in sorted order ascending. Now my main method is partly complete so can I get some help in finishing my main method. This means calling for the right classes and sorting the array ans displaying them. thank you</p>
