摘要: The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integernrepresenting the total number... 阅读全文
posted @ 2014-06-23 23:46 purejade 阅读(107) 评论(0) 推荐(0) 编辑
摘要: Implement pow(x,n).思想:二分法,注意n为负数的情况public double pow(double x, int n) {if(n==0) return 1;if(n==1) return x;double k = pow(x,Math.abs(n/2));if(n>0) {if... 阅读全文
posted @ 2014-06-23 23:37 purejade 阅读(92) 评论(0) 推荐(0) 编辑
摘要: Given a singly linked list where elements are sorted in ascending order, convert it to a height balanced BST.思想: 用二分法的思想进行求解,左子树,中间节点,右子树,利用slow和fast指... 阅读全文
posted @ 2014-06-23 23:33 purejade 阅读(66) 评论(0) 推荐(0) 编辑
摘要: Jump GameGiven an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents yo... 阅读全文
posted @ 2014-06-23 22:57 purejade 阅读(124) 评论(0) 推荐(0) 编辑
摘要: HP 打印机驱动移植到Fedora 9,以及其它新系统(无包管理工具) 阅读全文
posted @ 2014-06-23 22:46 purejade 阅读(757) 评论(0) 推荐(0) 编辑