码迷,mamicode.com
首页 >  
搜索关键字:return array    ( 86705个结果
java学习笔记(二)之数据部分
数据类型 java数据类型基本数据类型数值型整型byte/short/int/long浮点型/double/float字符型char布尔型boolean取值true false对象数据类型类Class接口 interface数组array[]类型 对象位数字节数最小值最大值byte Byte...
分类:编程语言   时间:2014-05-21 22:26:43    阅读次数:317
根据传入时间得到上一年下一年第一天和最后一天
/** * 获取上一年第一天的时间 返回yyyy-MM-dd * * @param enDate * @return */public Date getPreviousYearFirst(Date enDate) {Date date = enDate;SimpleDateFormat dateF....
分类:其他好文   时间:2014-05-21 22:15:15    阅读次数:370
堆排序
package com.bupt.acm;import java.util.Scanner;public class HeapSort { private int getLeft(int i){ return 2*(i+1)-1; } private int ...
分类:其他好文   时间:2014-05-21 22:01:39    阅读次数:246
13周 项目2 圆的比较
#include #include using namespace std; class Point { public: Point(double a,double b):x(a),y(b) {} double getx() { return x; } double gety() { return y; ...
分类:其他好文   时间:2014-05-21 10:09:26    阅读次数:309
多重背包模板
/** * 多重背包: * 有N种物品和一个容量为V的背包。第i种物品最多有Mi件可用, * 每件耗费的空间是Ci,价值是Wi。 * 求解将哪些物品装入背包可使这些物品的耗费的空间总和不超过背包容量,且价值总和最大。 */ #include #include int max(int a, int b){ if (a > b)return...
分类:其他好文   时间:2014-05-21 10:00:56    阅读次数:206
LeetCode:Two Sum
题目:       Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up t...
分类:其他好文   时间:2014-05-21 07:42:18    阅读次数:230
Leetcode:Reverse Linked List II 单链表区间范围内逆置
Reverse a linked list from position m to n. Do it in-place and in one-pass. For example: Given 1->2->3->4->5->NULL, m = 2 and n = 4, return 1->4->3->2->5->NULL. Note: Given m, n satisfy the fol...
分类:其他好文   时间:2014-05-21 07:18:02    阅读次数:301
HRBUST 1328 相等的最小公倍数
SOl:将原题改为枚举N的每一对因子,计算其是否互素即可。 #include #include #include using namespace std; inline int gcd(int a,int b) { return b==0?a:gcd(b,a%b); } int main() { int n,T,i,j; scanf("%d",&T); while(T...
分类:其他好文   时间:2014-05-21 07:07:00    阅读次数:273
LeetCode: Trapping Rain Water [041]
【题目】 Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining. For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], return 6. The above elevation map is represente...
分类:移动开发   时间:2014-05-21 06:44:38    阅读次数:359
【Leetcode】Jump Game
Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximu...
分类:其他好文   时间:2014-05-21 04:39:53    阅读次数:332
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!