码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
Lintcode: Backpack
Given n items with size A[i], an integer m denotes the size of a backpack. How full you can fill this backpack? NoteYou can not divide any item into s...
分类:其他好文   时间:2015-02-03 09:27:39    阅读次数:160
Counting Sort
1. Counting Sort doesn't work for negative number.2. Counting Sort assumes that each element is SMALL INTEGER.3. Time Complexity is O(Maximum value - ...
分类:其他好文   时间:2015-02-03 01:53:09    阅读次数:130
LeetCode:Merge Sorted Array
Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (size that is greater or equal to m + n) to hold additional elements from B....
分类:其他好文   时间:2015-02-02 23:12:19    阅读次数:171
Hibernate 基本增删改查操作
本文将要介绍Hibernate基本的增删改查的操作的实现,首先我们创建一个对象实例。一般情况下会创建User,本例也不例外需要创建这样的对象。 【转载使用,请注明出处:http://blog.csdn.net/mahoking】 User对象 public class User { private Integer id; private String userName; privat...
分类:Web程序   时间:2015-02-02 23:07:44    阅读次数:206
Leetcode#13 Roman to Integer
原题地址罗马数字的问题可以参考这篇博文,讲的很清楚代码: 1 int transfer(char c) { 2 switch (c) { 3 case 'I': return 1; 4 case 'V': return 5; 5 case 'X': return 10; 6 ca...
分类:其他好文   时间:2015-02-02 21:15:45    阅读次数:141
N-Queens -- leetcode
The n-queens puzzle is the problem of placing n queens on an n×n chessboard such that no two queens attack each other. Given an integer n, return all distinct solutions to the n-queens puzzle. ...
分类:其他好文   时间:2015-02-02 18:11:32    阅读次数:128
java时间戳转化
String aa="1422865572"; long nowTime=System.currentTimeMillis(); //当前时间戳//以下为时间戳转化 long retime =Integer.valueOf(aa).intValue(); SimpleDateFor...
分类:编程语言   时间:2015-02-02 17:57:55    阅读次数:201
Leetcode#8 String to Integer (atoi)
原题地址非常恶心的一道题,又是处理溢出问题根据经验,处理溢出问题应该:优先在还没溢出的时候检测运算后的结果是否会溢出,而不是等到溢出以后再去判断结果是否溢出比如,为了判断F(x)是否会溢出,应该推算出x的合法范围,当x不在合法范围内时,判定溢出。而不是计算出F(x)的值之后再判断是否会溢出。有时候计...
分类:其他好文   时间:2015-02-02 17:39:53    阅读次数:112
Ural 1010. Discrete Function
1010. Discrete FunctionTime limit: 1.0 secondMemory limit: 64 MBThere is a discrete function. It is specified for integer arguments from 1 toN(2 ≤N≤ 1...
分类:其他好文   时间:2015-02-02 14:08:20    阅读次数:131
从lambda到函数式编程
1 Object.send(:remove_const,'TRUE') 2 Object.send(:remove_const,'FALSE') 3 4 def to_integer(pro) 5 pro[-> n { n + 1 }][0] 6 end 7 8 def t...
分类:其他好文   时间:2015-02-01 23:16:58    阅读次数:272
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!