2017年4月8日
摘要: public class Dijkstra { static int maxint=1000; public static void Dijkstra(int n,int v,int dist[],int c[][],int prev[]){ boolean s[]=new boolean[n]; 阅读全文
posted @ 2017-04-08 20:11 足迹漫天涯 阅读(135) 评论(0) 推荐(0)
摘要: 合并排序算法: public class MergeSort { public static void MergeSort(int A[],int low,int high){ if(low<high){ int middle=(low+high)/2; MergeSort(A,low,middle 阅读全文
posted @ 2017-04-08 20:02 足迹漫天涯 阅读(443) 评论(0) 推荐(0)
摘要: public class Qsort { public static void Qsort(int A[],int low,int high){ if(low>=high)return; int key=A[low]; int i=low,j=high; while(i<j){ while(i<j& 阅读全文
posted @ 2017-04-08 20:00 足迹漫天涯 阅读(190) 评论(0) 推荐(0)
  2017年4月5日
摘要: 1 public static int Manacher(String A,int n){ 2 char AA[]=A.toCharArray(); 3 char BB[]=new char[2*n+3]; 4 int k=0; 5 for(int i=1;i<=2*n+1;i=i+2){ 6 BB 阅读全文
posted @ 2017-04-05 14:32 足迹漫天涯 阅读(111) 评论(0) 推荐(0)