public class QuickSort { public static void sort(int arr[],int low,int high){ int l=low; int h=high; int temp=arr[low]; ...
分类:
其他好文 时间:
2014-09-09 11:15:48
阅读次数:
241
import java.util.Scanner;public class Main { private static int count=0; public static void mergesort(int a[],int low,int high) { if(l...
分类:
编程语言 时间:
2014-09-09 10:39:58
阅读次数:
241
public class Solution { public boolean searchMatrix(int[][] matrix, int target) { int low=0, high=matrix.length-1; while (low target)...
分类:
其他好文 时间:
2014-09-08 00:58:06
阅读次数:
347
public class Solution { public int maxArea(int[] height) { int len = height.length, low = 0, high = len - 1; int area = 0; whi...
分类:
其他好文 时间:
2014-09-07 23:40:15
阅读次数:
233
基本思想 设归并排序的当前区间是R[low..high],分治法的三个步骤是: ①分解:将当前区间一分为二,即求分裂点 ②求解:递归地对两个子区间R[low..mid]和R[mid+1..high]进行归并排序; ③组合:将已排序的两个子区间R[low..mid]和R[mid+1..high]归并为一个有序的区间R[low..high]。...
分类:
其他好文 时间:
2014-09-07 19:50:35
阅读次数:
244
1 public class QuickSort { 2 3 public void sort(int[] k,int low,int high) 4 { 5 int point; 6 if(low=point) //当右边的值比中轴值...
分类:
其他好文 时间:
2014-09-07 12:13:45
阅读次数:
220
原文来自于:http://www.sitepoint.com/best-php-frameworks-2014/Update: If you’d like to take part in the next high-yield survey from SitePoint, please vote f...
分类:
Web程序 时间:
2014-09-05 22:21:02
阅读次数:
376
#include
using namespace std;
int find2(int A[],int n)
{
int high=n-1;
int low =0;
int mid;
while(A[high]<=A[low])
{
if(high-low==1)
{
mid=high;
break;
}
...
分类:
其他好文 时间:
2014-09-04 22:18:50
阅读次数:
216
1 //快速排序 2 public static int partion(T a[],int low,int high) 3 { 4 T pivo=a[low]; 5 while(low=0)13 {14 ...
分类:
其他好文 时间:
2014-09-04 18:51:19
阅读次数:
211