@@ -0,0 +1,1857 @@
+/* ============================================================================%0D%0A * Copyright (c) 2015 Imagic Bildverarbeitung AG, CH-8152 Glattbrugg.%0D%0A * All rights reserved.%0D%0A *%0D%0A * http://www.imagic.ch/%0D%0A * ============================================================================%0D%0A */%0D%0Apackage algorithm;%0D%0A%0D%0Aimport java.util.ArrayList;%0D%0Aimport java.util.List;%0D%0Aimport java.util.Scanner;%0D%0A%0D%0A/**%0D%0A *%0D%0A * @version $Revision$%0D%0A * @version $Date$%0D%0A * @author $Author$%0D%0A * @owner Sandro Mario Zbinden%0D%0A */%0D%0Apublic class Quicksort1Partition %7B%0D%0A    public static class Solution %7B%0D%0A%0D%0A        public static void quicksortPartition(int%5B%5D a) %7B%0D%0A            int pivot = a%5B0%5D;%0D%0A            List%3CInteger%3E leftPartion = new ArrayList%3C%3E();%0D%0A            List%3CInteger%3E rightPartion = new ArrayList%3C%3E();%0D%0A            for (int i = 1; i %3C a.length; i++) %7B%0D%0A                if (a%5Bi%5D %3E pivot) %7B%0D%0A                    rightPartion.add(a%5Bi%5D);%0D%0A                %7D else %7B%0D%0A                    leftPartion.add(a%5Bi%5D);%0D%0A                %7D%0D%0A            %7D%0D%0A            List%3CInteger%3E result = new ArrayList%3C%3E();%0D%0A            result.addAll(leftPartion);%0D%0A            result.add(pivot);%0D%0A            result.addAll(rightPartion);%0D%0A            printArray(result);%0D%0A        %7D%0D%0A%0D%0A        static void printArray(List%3CInteger%3E ar) %7B%0D%0A            for (int n : ar) %7B%0D%0A                System.out.print(n + %22 %22);%0D%0A            %7D%0D%0A        %7D%0D%0A%0D%0A        public static void main(String%5B%5D args) %7B%0D%0A            try (Scanner in = new Scanner(System.in)) %7B%0D%0A                int n = in.nextInt();%0D%0A                int%5B%5D ar = new int%5Bn%5D;%0D%0A                for (int i = 0; i %3C n; i++) %7B%0D%0A                    ar%5Bi%5D = in.nextInt();%0D%0A                %7D%0D%0A                quicksortPartition(ar);%0D%0A            %7D%0D%0A        %7D%0D%0A    %7D%0D%0A%0D%0A    public static void main(String%5B%5D args) %7B%0D%0A        Solution.main(null);%0D%0A    %7D%0D%0A%7D%0D%0A

Solve the Quicksort1Partition challange