摘要:
import java.io.BufferedReader;import java.io.IOException;import java.io.InputStreamReader; public class InputString { public static String getString() throws IOException{ InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); S... 阅读全文
摘要:
import java.io.IOException;import Input.InputString; /** * 冒泡排序 * @author xiaomi * 2012.3.29 */public class BubbleSort { public static void main(String[] args) throws IOException{ String s = InputString.getString(); String[] str = s.split(" "); int[] a = new int[str.length]; ... 阅读全文
摘要:
import java.io.IOException;import Input.InputString; /** * 选择排序 * @author xiaomi * 2012.3.29 */public class SelectSort { public static void main(String[] args) throws IOException{ String s = InputString.getString(); String[] str = s.split(" "); int[] a = new int[str.length]; ... 阅读全文
摘要:
import java.io.IOException;import Input.InputString; /** * 插入排序 * @author xiaomi * 2012.3.29 */public class InsertSort { public static void main(String[] args) throws IOException{ String s = InputString.getString(); String[] str = s.split(" "); int[] a = new int[str.length]; ... 阅读全文
摘要:
import java.io.IOException;import Input.InputString; /** * 希尔排序 * @author xiaomi * 2012.3.29 */public class ShellSort { public static void main(String[] args) throws IOException{ String s = InputString.getString(); String[] str = s.split(" "); int[] a = new int[str.length]; ... 阅读全文
摘要:
import java.io.IOException;import Input.InputString; /** * 快速排序 * @author xiaomi * 2012.04.02 */public class MergeSort { public static void main(String[] args) throws IOException{ String s = InputString.getString(); String[] str = s.split(" "); int[] a = new int[str.length];... 阅读全文
摘要:
/** * 快速排序 * @author xiaomi * 2012.4.2 */public class QuickSort { public static void main(String[] args) throws IOException{ String s = InputString.getString(); String[] str = s.split(" "); int[] a = new int[str.length+1]; for(int i = 0;i = pivot){ high-... 阅读全文
摘要:
package Sort;import java.io.IOException;import Input.InputString;public class HeapSort { /** * @param args */ public static void main(String[] args) { // TODO Auto-generated method stub try { String str = InputString.getString(); String[] s = str.spl... 阅读全文