导航

2015年8月18日

摘要: 关键代码截图如下: 阅读全文

posted @ 2015-08-18 21:50 骄阳照林 阅读(245) 评论(0) 推荐(0) 编辑

2015年8月16日

摘要: Implement a trie withinsert,search, andstartsWithmethods.Note:You may assume that all inputs are consist of lowercase lettersa-z.思路:实现单词查找树,它是一种树形结构;用... 阅读全文

posted @ 2015-08-16 17:05 骄阳照林 阅读(193) 评论(0) 推荐(0) 编辑

摘要: Design a data structure that supports the following two operations:void addWord(word)bool search(word)search(word) can search a literal word or a regu... 阅读全文

posted @ 2015-08-16 15:22 骄阳照林 阅读(130) 评论(0) 推荐(0) 编辑

摘要: Given a binary tree, return all root-to-leaf paths.For example, given the following binary tree: 1 / \2 3 \ 5All root-to-leaf paths are:["1->... 阅读全文

posted @ 2015-08-16 12:16 骄阳照林 阅读(130) 评论(0) 推荐(0) 编辑

2015年8月15日

摘要: 360员工桂最近申请了一个长假,一个人背着包出去自助游了。 路上,他经过了一个小镇,发现小镇的人们都围在一棵树下争吵。桂上前询问情况,得知小镇的人们正缺一个镇长,他们希望能选一个知名又公正的镇长,即,大家希望能选出一个人,所有人都认识他,但同时他不认识镇上除自己以外的其他人(在此,我们默认每个人自... 阅读全文

posted @ 2015-08-15 11:17 骄阳照林 阅读(306) 评论(0) 推荐(0) 编辑

2015年8月14日

摘要: 最后一个字符正在挑战一个CrackMe的你,把需要填写的前面几位密码都正确猜出了,可是这最后一位密码,好像藏得有点深。CrackMe的作者还挑衅般的在里面藏了个.tar.gz文件,解压缩出来,里面写道你要的最后一个字符就在下面这个字符串里。这个字符是下面整个字符串中第一个只出现一次的字符。 (比如,... 阅读全文

posted @ 2015-08-14 12:37 骄阳照林 阅读(215) 评论(0) 推荐(0) 编辑

2015年8月9日

摘要: 1.BFS实现public class Solution { public int[] findOrder(int numCourses, int[][] prerequisites) { int[] incLinkCounts = new int[numCourses]; ... 阅读全文

posted @ 2015-08-09 22:15 骄阳照林 阅读(659) 评论(0) 推荐(0) 编辑

摘要: There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have to firs... 阅读全文

posted @ 2015-08-09 21:40 骄阳照林 阅读(112) 评论(0) 推荐(0) 编辑

摘要: There are a total ofncourses you have to take, labeled from0ton - 1.Some courses may have prerequisites, for example to take course 0 you have to firs... 阅读全文

posted @ 2015-08-09 14:11 骄阳照林 阅读(224) 评论(0) 推荐(0) 编辑

摘要: Given an array of integers, find out whether there are two distinct indicesiandjin the array such that the difference betweennums[i]andnums[j]is at mo... 阅读全文

posted @ 2015-08-09 12:15 骄阳照林 阅读(136) 评论(0) 推荐(0) 编辑