码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
Power of Two
Given an integer, write a function to determine if it is a power of two.1 bool isPowerOfTwo(int n) {2 if(n<=0)3 return false;4 if(n&(n-1...
分类:其他好文   时间:2015-07-23 13:44:20    阅读次数:97
Majority Element II
Given an integer array of sizen, find all elements that appear more than? n/3 ?times. The algorithm should run in linear time and in O(1) space.Hint:H...
分类:其他好文   时间:2015-07-23 13:41:41    阅读次数:103
Number of Digit One
Given an integer n, count the total number of digit 1 appearing in all non-negative integers less than or equal to n.For example:Given n = 13,Return 6...
分类:其他好文   时间:2015-07-23 13:38:27    阅读次数:102
Summary Ranges
Given a sorted integer array without duplicates, return the summary of its ranges.For example, given[0,1,2,4,5,7], return["0->2","4->5","7"]. 1 class ...
分类:其他好文   时间:2015-07-23 13:37:12    阅读次数:112
关于Java传值&传引用的一道题
public class JavaTestDemo1 { public static void main(String[] args) { Integer v1 = new Integer(1); Integer v2 = v1; doSomething(v2); System.out.println(v2); System.out.println(v1 == v2); ...
分类:编程语言   时间:2015-07-23 12:05:54    阅读次数:111
Android中 int 和 String 互相转换的多种方法
1 如何将字串 String 转换成整数 int?A. 有两个方法:1). int i = Integer.parseInt([String]); 或i = Integer.parseInt([String],[int radix]);2). int i = Integer.valueOf(my_s...
分类:移动开发   时间:2015-07-23 09:21:08    阅读次数:143
108 Convert Sorted Array to Binary Search Tree
108 Convert Sorted Array to Binary Search Tree递归解法还是非常直观的class Solution: # @param {integer[]} nums # @return {TreeNode} def sortedArrayToBST(...
分类:其他好文   时间:2015-07-23 07:01:29    阅读次数:192
103 Binary Tree Zigzag Level Order Traversal
103 Binary Tree Zigzag Level Order Traversallevel traversal的变种class Solution: # @param {TreeNode} root # @return {integer[][]} def zigzagLeve...
分类:其他好文   时间:2015-07-23 06:51:24    阅读次数:116
102 Binary Tree Level Order Traversal
102 Binary Tree Level Order Traversalclass Solution: # @param {TreeNode} root # @return {integer[][]} def levelOrder(self, root): if r...
分类:其他好文   时间:2015-07-23 06:41:43    阅读次数:96
HDU 4370 0 or 1
0 or 1Time Limit: 2000msMemory Limit: 32768KBThis problem will be judged onHDU. Original ID:437064-bit integer IO format:%I64d Java class name:MainGiv...
分类:其他好文   时间:2015-07-22 22:37:21    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!