@@ -0,0 +1,1214 @@
+//This algorithm is designed to take N length substrings from a string and sort them%0A//lexicographically in ascending order.%0A%0Aimport java.io.*;%0Aimport java.util.*;%0A%0Apublic class SubStringSort %7B%0A    %0A    static Scanner in = new Scanner(System.in);%0A    %0A    public static void main(String%5B%5D args) throws IOException %7B%0A        //original string and length N%0A        String str = in.nextLine();%0A        int length = in.nextInt();%0A        %0A        String largestSub, smallestSub;%0A        String subStr = %22%22;%0A        %0A        //ArrayList to store substrings, in order to allow for dynamic growth or contraction%0A        ArrayList%3CString%3E strArray = new ArrayList%3CString%3E();%0A    %0A       for (int i = 0; i %3C str.length() - 1; i++) %7B%0A           if (i + length %3C= str.length()) %7B //avoids out of bounds issues%0A               subStr = str.substring(i, i + length);%0A               strArray.add(subStr);%0A           %7D%0A           else break;%0A       %7D%0A       %0A       //Collection methods allow for lexicographical sort%0A       Collections.sort(strArray);%0A       %0A       smallestSub = strArray.get(0);%0A       largestSub = strArray.get(strArray.size() - 1);%0A       %0A       System.out.println(smallestSub + %22%5Cn%22 + largestSub);%0A    %7D%0A%7D%0A

Create SubStringSort.java