上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页

2017年6月15日

摘要: Note: This is to count the level. At beginning, since there are so many zombies, we need to add all of them to the Queue to start with. It is differen 阅读全文
posted @ 2017-06-15 11:22 codingEskimo 阅读(117) 评论(0) 推荐(0) 编辑
摘要: This is Matrix Problem which can be converted to BSF: Loop through each node, if it is island, find the edge. Inside the mark them all as sea. So it w 阅读全文
posted @ 2017-06-15 07:46 codingEskimo 阅读(81) 评论(0) 推荐(0) 编辑
摘要: Only Path :判断是否只存在一个拓扑排序的序列 只需要保证队列中一直最多只有1个元素即可 tricky part:1) org has all the nodes. That is why each time there should only be 1 element in the que 阅读全文
posted @ 2017-06-15 06:17 codingEskimo 阅读(197) 评论(0) 推荐(0) 编辑

2017年6月14日

摘要: The same as I: 阅读全文
posted @ 2017-06-14 08:50 codingEskimo 阅读(71) 评论(0) 推荐(0) 编辑
摘要: Note: 1) For integer node 0~n, we don't need a hashmap, we can just use array to act like a map; 2) How to initial List[] is very important 3) We need 阅读全文
posted @ 2017-06-14 08:38 codingEskimo 阅读(114) 评论(0) 推荐(0) 编辑
摘要: Topological Sorting is very important, almost every company has a question related to it. Goal: To find an proper order making the front nodes are ind 阅读全文
posted @ 2017-06-14 06:52 codingEskimo 阅读(165) 评论(0) 推荐(0) 编辑
摘要: Note: BSF: if it needs to check the value, should check it when it is coming from Queue. The logic is most clear to do it there. This question is to a 阅读全文
posted @ 2017-06-14 06:06 codingEskimo 阅读(177) 评论(0) 推荐(0) 编辑

2017年6月13日

摘要: This question is the same as Binary Tree Treverse in Level Order. Instead of a list, we need ListNode to remeber the result. The tricky part is that w 阅读全文
posted @ 2017-06-13 09:36 codingEskimo 阅读(416) 评论(0) 推荐(0) 编辑
摘要: Similar to Binary Tree Level Order Travel, just need to add a flag to remeber the order. Change the order to opposite after the level is over. 阅读全文
posted @ 2017-06-13 09:18 codingEskimo 阅读(93) 评论(0) 推荐(0) 编辑
摘要: This is very similar to Binary Tree Level Order Traversal. Just reverse the order of the list. ArrayList has API- > add(int index, Element) or Collect 阅读全文
posted @ 2017-06-13 09:06 codingEskimo 阅读(86) 评论(0) 推荐(0) 编辑
上一页 1 ··· 4 5 6 7 8 9 10 11 12 ··· 18 下一页

导航