上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页
摘要: 题目:Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a let... 阅读全文
posted @ 2015-11-01 16:11 lasclocker 阅读(145) 评论(0) 推荐(0) 编辑
摘要: 题目:Serialization is the process of converting a data structure or object into a sequence of bits so that it can be stored in a file or memory buffer, ... 阅读全文
posted @ 2015-11-01 15:33 lasclocker 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 题目:You are playing the following Nim Game with your friend: There is a heap of stones on the table, each time one of you take turns to remove 1 to 3 s... 阅读全文
posted @ 2015-11-01 09:43 lasclocker 阅读(262) 评论(0) 推荐(0) 编辑
摘要: 题目:You are playing the following Bulls and Cows game with your friend: You write a 4-digit secret number and ask your friend to guess it, each time yo... 阅读全文
posted @ 2015-10-31 22:01 lasclocker 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 不知道按到哪个快捷键了,发现windows7系统桌面,浏览器,PDF阅读器和Eclipse的北京和菜单都编程淡黄色,下面是解决的过程。方法一:在win7桌面右击 -> 个性化 -> 窗口颜色 -> 高级外观设置 -> 项目,在项目中选择要更改的项。发现这种方法失效,之后重启电脑,依然不行。方法二:在... 阅读全文
posted @ 2015-10-30 19:21 lasclocker 阅读(438) 评论(0) 推荐(0) 编辑
摘要: Java的类初始化过程:1. 父类的static成员变量,static语句块。2. 子类的static成员变量,static语句块。3. 父类的普通成员变量,构造函数。4. 子类的普通成员变量,构造函数。注意:如果下面一句话没看懂,没关系,看下面的一个例子就明白了~如果子类覆盖了父类的成员函数,该成... 阅读全文
posted @ 2015-10-29 16:44 lasclocker 阅读(205) 评论(0) 推荐(0) 编辑
摘要: 题目:翻转二叉树,例如 4 / \ 2 7 / \ / \1 3 6 9to 4 / \ 7 2 / \ / \9 6 3 1已知二叉树的节点定义如下:class TreeNode { int val; Tr... 阅读全文
posted @ 2015-10-27 17:38 lasclocker 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 题目:在一个数组中,除了两个数外,其余数都是两两成对出现,找出这两个数,要求时间复杂度O(n),空间复杂度O(1)分析:这道题考察位操作:异或(^),按位与(&),移位操作(>>, >= 1; } int num1 = 0, num2 = 0; int tm... 阅读全文
posted @ 2015-10-25 22:03 lasclocker 阅读(415) 评论(0) 推荐(0) 编辑
摘要: 题目:已知rand5()函数能随机等概率的生成0, 1, 2, 3, 4,利用rand5()函数编写一个rand7()函数实现相似的功能。分析:其实就是利用rand5()组合成一个更大范围的数,之后利用求余(%)再映射到0-6之间。Java代码: int rand7() { //已知rand5... 阅读全文
posted @ 2015-10-25 20:32 lasclocker 阅读(866) 评论(0) 推荐(1) 编辑
摘要: 题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.分析:固定一个点,遍历其余点,期间用一个HashMap记录两点斜率和斜率次数,求出局部最大值;然... 阅读全文
posted @ 2015-10-21 10:45 lasclocker 阅读(262) 评论(0) 推荐(0) 编辑
上一页 1 ··· 5 6 7 8 9 10 11 12 13 ··· 16 下一页