03 2015 档案

摘要:废话不多说,上代码:void quicksort(int x[], int lo, int hi){ int i = lo, j = hi; int pivot = x[(lo + hi) >> 1]; while(i pivot) j--; if(i <= j){... 阅读全文
posted @ 2015-03-28 08:26 zmiao 阅读(108) 评论(0) 推荐(0) 编辑
摘要:The size, isEmpty, get, set, iterator, and listIterator operations run in constant time. The add operation runs in amortized constant time, that is, a... 阅读全文
posted @ 2015-03-27 11:50 zmiao 阅读(213) 评论(0) 推荐(0) 编辑
摘要:c++里最快的io方式是什么呢?详见这里。同时给出一个比较常用的方式,就是用fread.然后自己解析文本,而不是用cin或者scanf,见这里://fast io test#include #include const int MAXS = 30* 1024* 1024;char buf[MAXS]... 阅读全文
posted @ 2015-03-25 15:26 zmiao 阅读(610) 评论(0) 推荐(0) 编辑
摘要:传入 数组A, 以及要查找的范围[lo, hi)int binSearch(int A[], int goal, int lo, int hi){ while (lo > 1; (goal < A[mi]) ? hi = mi : lo = mi + 1; } r... 阅读全文
posted @ 2015-03-24 04:21 zmiao 阅读(114) 评论(0) 推荐(0) 编辑