上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 46 下一页

2015年1月20日

Rotate List

摘要: Given a list, rotate the list to the right bykplaces, wherekis non-negative.For example:Given1->2->3->4->5->NULLandk=2,return4->5->1->2->3->NULL.这道题有点... 阅读全文

posted @ 2015-01-20 11:16 luckygxf 阅读(222) 评论(0) 推荐(0)

2015年1月19日

Unique Paths II

摘要: Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty space i... 阅读全文

posted @ 2015-01-19 21:42 luckygxf 阅读(150) 评论(0) 推荐(0)

Unique Paths

摘要: A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any point ... 阅读全文

posted @ 2015-01-19 20:37 luckygxf 阅读(195) 评论(0) 推荐(0)

Integer to Roman

摘要: Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999. 1 public class Solution { 2 public Stri... 阅读全文

posted @ 2015-01-19 20:02 luckygxf 阅读(131) 评论(0) 推荐(0)

2015年1月18日

Search for a Range

摘要: Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be in the ord... 阅读全文

posted @ 2015-01-18 16:08 luckygxf 阅读(171) 评论(0) 推荐(0)

Next Permutation

摘要: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possibl... 阅读全文

posted @ 2015-01-18 15:37 luckygxf 阅读(163) 评论(0) 推荐(0)

2015年1月16日

Divide Two Integers

摘要: 参考:http://www.cnblogs.com/springfor/p/3871008.htmlDivide two integers without using multiplication, division and mod operator.If it is overflow, retur... 阅读全文

posted @ 2015-01-16 15:48 luckygxf 阅读(145) 评论(0) 推荐(0)

java 判断两个数是否异号

摘要: java 整型int占4个字节32位,两个数异或后移动31位判断结果,如果是1则异号,如果是0则同号 1 public class ShowEnviromentViarible { 2 3 public static void main(String[] args) { 4 ... 阅读全文

posted @ 2015-01-16 12:27 luckygxf 阅读(1625) 评论(0) 推荐(0)

字节顺序的详细解释(转)

摘要: 原出处:http://blog.csdn.net/yingfox/article/details/1831848一、基本概念位的概念:在计算机中,一个0或1称为一位(bit)。字节:连续的八位称为一个字节(Byte),字节是计算机中可单独处理的最小单位。即以字节为基本单位来解释信息,规定1个字节是8... 阅读全文

posted @ 2015-01-16 09:36 luckygxf 阅读(3499) 评论(0) 推荐(0)

2015年1月15日

java无符号移位(>>>)和有符号移位(>>)

摘要: java中>>(>>)表示无符号移位如:int num = 22;二进制是0001 0110, num>>>1,右移一位变成0000 1011(11)int num = -22二进制用补码表示:1110 1001, num >>>1无符号右移一位: 0111 0100>>向右移动后,最左边用符号位替... 阅读全文

posted @ 2015-01-15 22:40 luckygxf 阅读(426) 评论(0) 推荐(0)

上一页 1 ··· 25 26 27 28 29 30 31 32 33 ··· 46 下一页

导航