码迷,mamicode.com
首页 >  
搜索关键字:integer    ( 14932个结果)
用 O(1) 时间检测整数 n 是否是 2 的幂次。
位操作2的幂次数2 104 1008 100016 10000... 1 class Solution { 2 /* 3 * @param n: An integer 4 * @return: True or false 5 */ 6 public bo...
分类:其他好文   时间:2015-06-30 14:29:52    阅读次数:102
LeetCode150 Evaluate Reverse Polish Notation java题解
题目: Evaluate the value of an arithmetic expression in Reverse Polish Notation. Valid operators are +, -, *, /. Each operand may be an integer or another expression. Some examples: ["...
分类:编程语言   时间:2015-06-30 13:05:37    阅读次数:136
leetcode - Palindrome Number
Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (i...
分类:其他好文   时间:2015-06-30 12:47:25    阅读次数:82
Hibernate设置派生属性(formula)
一、Customer中包含的字段:private static final long serialVersionUID = 1L; private Integer id; private String sex; private double salary; private Double comm; ...
分类:Web程序   时间:2015-06-30 12:28:14    阅读次数:134
重踏学习Java路上_Day13(StringBuffer,Array与数组,Integer,Character)
1:StringBuffer(掌握) (1)用字符串做拼接,比较耗时并且也耗内存,而这种拼接操作又是比较常见的,为了解决这个问题,Java就提供了 一个字符串缓冲区类。StringBuffer供我们使用。 (2)StringBuffer的构造方法 A:StringBuffer() B:Stri...
分类:编程语言   时间:2015-06-30 08:56:33    阅读次数:144
Majority Element II——LeetCode
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.题目大意:给...
分类:其他好文   时间:2015-06-30 07:45:12    阅读次数:487
LeetCode "Roman to Integer"
class Solution {public: int romanToInt(string s) { std::unordered_map hm; hm['M'] = 1000; hm['D'] = 500; hm['C'] = ...
分类:其他好文   时间:2015-06-30 06:34:48    阅读次数:105
LeetCode "Integer to Roman"
char dict[] = {'I', 'V', 'X', 'L', 'C', 'D', 'M'};class Solution { public: string pattern(int v, int level) { int offset = int(log10(l...
分类:其他好文   时间:2015-06-30 06:34:47    阅读次数:121
[LintCode] 合并排序数组II
1 class Solution { 2 public: 3 /** 4 * @param A: sorted integer array A which has m elements, 5 * but size of A is m+n 6 ...
分类:编程语言   时间:2015-06-29 23:48:23    阅读次数:346
Summary Ranges —— LeetCode
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"].题目大意:给一个有...
分类:其他好文   时间:2015-06-29 23:47:05    阅读次数:116
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!