上一页 1 2 3 4 5 6 7 8 9 10 ··· 46 下一页
摘要: Given an array nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k nu... 阅读全文
posted @ 2015-07-20 01:00 卖程序的小歪 阅读(180) 评论(0) 推荐(0) 编辑
摘要: # 写在前面要做个元数据服务,包括存储和查询。元数据除了一些基本字段外,其他格式是自由的,存储输入为一个`JSON`形式。比如下面是一个文件对象的元数据:```{ "name":"myfile", "type":"file", "user":"ubuntu" "path":"... 阅读全文
posted @ 2015-07-17 13:19 卖程序的小歪 阅读(217) 评论(0) 推荐(0) 编辑
摘要: >Given an array of n integers where n > 1, nums, return an array output such that output[i] is equal to the product of all the elements of nums except... 阅读全文
posted @ 2015-07-17 00:32 卖程序的小歪 阅读(102) 评论(0) 推荐(0) 编辑
摘要: >Write a function to delete a node (except the tail) in a singly linked list, given only access to that node.>Supposed the linked list is 1 -> 2 -> 3 ... 阅读全文
posted @ 2015-07-16 23:55 卖程序的小歪 阅读(118) 评论(0) 推荐(0) 编辑
摘要: #ExecutorExecutor仅仅是一个简单的接口,其定义如下```public interface Executor { void execute(Runnable command);}```作为一个简单的线程池的话,实现这个接口就可以使用了。不过单单这样的话,无法使用Future功能。... 阅读全文
posted @ 2015-07-16 17:22 卖程序的小歪 阅读(415) 评论(0) 推荐(0) 编辑
摘要: #Future当向一个ExecutorService提交任务后可以获得一个Future对象,在该对象上可以调用`get`,`cancel`等命令来获取任务运行值或者是取消任务。下面是一个简单的计数任务:```public class NormalFuture { public static v... 阅读全文
posted @ 2015-07-15 16:01 卖程序的小歪 阅读(2096) 评论(0) 推荐(0) 编辑
摘要: >Given a binary tree, find the lowest common ancestor (LCA) of two given nodes in the tree.>According to the definition of LCA on Wikipedia: “The lowe... 阅读全文
posted @ 2015-07-13 20:17 卖程序的小歪 阅读(114) 评论(0) 推荐(0) 编辑
摘要: >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,>Retu... 阅读全文
posted @ 2015-07-11 20:37 卖程序的小歪 阅读(178) 评论(0) 推荐(0) 编辑
摘要: >Given a singly linked list, determine if it is a palindrome.>Follow up:>Could you do it in O(n) time and O(1) space?```/** * Definition for singly-li... 阅读全文
posted @ 2015-07-11 19:49 卖程序的小歪 阅读(214) 评论(0) 推荐(0) 编辑
摘要: >Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.>According to the definition of LCA on Wikipedi... 阅读全文
posted @ 2015-07-11 19:33 卖程序的小歪 阅读(140) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 46 下一页