package org.psjava.example.algo;

import junit.framework.Assert;

import org.junit.Test;
import org.psjava.algo.sequence.sort.RandomizedQuicksort;
import org.psjava.ds.array.MutableArray;
import org.psjava.ds.array.MutableArrayFromValues;
import org.psjava.util.DefaultComparator;

/**
 * @implementation {@link RandomizedQuicksort}
 * @see {@link SortingAlgorithmExample}
 */
public class QuicksortExample {
	@Test
	public void example() {
		MutableArray<Integer> array = MutableArrayFromValues.create(2, 1, 3);
		RandomizedQuicksort.getInstance().sort(array, new DefaultComparator<Integer>());
		Assert.assertEquals("(1,2,3)", array.toString());
	}
}

@@ -240,16 +240,60 @@
 alues;%0D%0A
+import org.psjava.example.ds.ArrayExample;%0D%0A
 import o
@@ -423,16 +423,46 @@
 ample%7D%0D%0A
+ * @see %7B@link ArrayExample%7D%0D%0A
  */%0D%0Apub

improve QuicksortExample