Given an integer, write a function to determine if it is a power of two.Solution:一个整数如果是2的整数次方,那么它的二进制表示中有且只有一位是1,而其他所有位都是0。把这个整数与这个整数减去1之后进行与运算,那么这个整...
分类:
其他好文 时间:
2015-07-28 00:42:12
阅读次数:
110
Determine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)If you are thinki...
分类:
其他好文 时间:
2015-07-28 00:31:41
阅读次数:
124
构造方法都是带参的方法A:String ---》int Integer.parseInt("100");B:int---》String String.valueOf(100);currentTimeMillis返回当前时间(单位毫秒)
分类:
其他好文 时间:
2015-07-27 22:41:09
阅读次数:
130
Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321notice:Have you thought about this?Here are some good questions...
分类:
其他好文 时间:
2015-07-27 22:41:05
阅读次数:
98
Forwarding EmailsTime Limit: 1000msMemory Limit: 131072KBThis problem will be judged onUVA. Original ID:1244264-bit integer IO format:%lld Java class ...
分类:
其他好文 时间:
2015-07-27 22:27:25
阅读次数:
109
1、错误描述java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.String
service.impl.ArrivalBillServiceImpl.exportBillExcel(BillServiceImpl.java:266)
at sun.reflect.NativeMethodAcce...
分类:
编程语言 时间:
2015-07-27 21:11:12
阅读次数:
312
生成java实体的脚本import MySQLdbimport sysdbhost='192.168.2.200'dbport=3306dbuser='root'dbpassword='zufangbao69fc'dbname='houseloan'dbtypes = {'int':'Integer...
分类:
编程语言 时间:
2015-07-27 18:08:32
阅读次数:
176
Number of 1 BitsWrite a function that takes an unsigned integer and returns the number of ’1' bits it has (also known as theHamming weight).For exampl...
分类:
其他好文 时间:
2015-07-27 14:47:21
阅读次数:
98
public class Test{public static void main(String[] args){Integer i1 = 100;Integer i2 = 100;if(i1 == i2){System.out.println("i1==i2");}else{System.out....
分类:
其他好文 时间:
2015-07-27 14:44:41
阅读次数:
81
Majority Element II
Given an integer array of size n,
find all elements that appear more than ? n/3 ? times.
The algorithm should run in linear time and in O(1) space.
解题思路:
此前做了一道题目,返回主要元...
分类:
其他好文 时间:
2015-07-27 13:15:53
阅读次数:
103