2014年2月16日

quick sort

摘要: import java.util.Comparator;import java.util.PriorityQueue;public class solution2 { public static void main(String[] args) { // TODO Auto-generated method stub int A[] = {3,4,6,3,5,33,8,6,4,3,2,1,4,0,3}; quickSort(A,0,A.length-1); for(int i : A){ System.out.... 阅读全文

posted @ 2014-02-16 16:54 brave_bo 阅读(135) 评论(0) 推荐(0)

quicksort liner find kth smallest or

摘要: Let's solve a problem with application of quick sort.Problem statementGiven an set of numbers in non-sorted order, find the Kth smallest element.Kth s... 阅读全文

posted @ 2014-02-16 15:27 brave_bo 阅读(312) 评论(0) 推荐(0)

comparator for String

摘要: import java.util.Comparator;import java.util.PriorityQueue;public class solution2 { /** * @param args */ @SuppressWarnings("unchecked") PriorityQueue queue = new PriorityQueue(2,new comparatorString()); public static void main(String[] args) { // TODO Auto-... 阅读全文

posted @ 2014-02-16 11:49 brave_bo 阅读(514) 评论(0) 推荐(0)

导航