#include using namespace std;void merge(int* ptr,int first, int mid, int last){ int len = last - first + 1; int *temp = new int[len]; ...
分类:
其他好文 时间:
2014-08-25 20:59:14
阅读次数:
229
No.1QuickSort快排void QuickSort(int[] l,int left,int right) { if(left=i;j--) if(v[j-1]>v[j]){ int temp=v[j-1]; v[j-1]=v[j]; v[...
分类:
编程语言 时间:
2014-08-25 16:53:34
阅读次数:
171
一、创建文件~ BulletLayer.h BulletLayer.cpp 二、How to do? (1)实例化BulletLayer方法的实现~ Bullet(PlayerLayer* temp); ~Bullet(); static Bullet* create(PlayerLayer *te...
分类:
微信 时间:
2014-08-25 13:09:24
阅读次数:
466
记录动态规划dpl,dpr,分辨记录i左面的比i大的,右面比i大的,然后(dpr[i]-dpl[i]+1)*h[i]得出长度
动态转移方程while(temp>1 && h[temp-1]>=h[i]) temp=dpl[temp-1]
/*************************************************************************
> F...
分类:
其他好文 时间:
2014-08-25 01:11:53
阅读次数:
248
一、在C中,当我们无法列出传递函数的所有实参的类型和数目时,可以用省略号指定参数表。void fun(...);void fun(parm_list,...);#include void fun(int n,...){ int *temp=&n; temp++; for(int i...
分类:
其他好文 时间:
2014-08-24 22:07:53
阅读次数:
213
最近有些懒,好久没写代码了,现在写个快排练练手吧。public class QucikSort { //此处交换两个数 public static void swap(int a[],int low,int high) { int temp=a[low]; a[low]=a[high]; a[...
分类:
其他好文 时间:
2014-08-24 20:52:32
阅读次数:
179
递归打印lua中的table,并写到文件里: 1 local pairs_by_keys = function(inTable) 2 local temp = {} 3 for k, v in pairs(inTable) do 4 temp[#temp + ...
分类:
其他好文 时间:
2014-08-23 20:14:11
阅读次数:
218
package com.learning.algorithm;public class BubbleSort { public int[] bubbleSort1(int[] arrValue){ int temp =0; int length = arrV...
分类:
其他好文 时间:
2014-08-23 17:40:31
阅读次数:
188
1 //冒泡排序 把一个数组里面的数从大到小排列 2 int[] nums = new int[7] { 7, 6, 8, 5, 1, 9, 4 }; 3 int temp; 4 //外循环每次把参与排序的最大数排在最后 5 for (int i = 1; i <= 6; i++)//每个数i要.....
分类:
其他好文 时间:
2014-08-23 16:45:31
阅读次数:
272
DecimalFormat format = (DecimalFormat) NumberFormat.getPercentInstance();format.applyPattern( "#####0 ");String temp = format.format(Double.MAX...
分类:
编程语言 时间:
2014-08-23 09:55:20
阅读次数:
350