摘要: http://www.lintcode.com/en/problem/permutations/# Given a list of numbers, return all possible permutations. Example For nums = [1,2,3], the permutations are: [ [1,2,3], [1,3,2], ... 阅读全文
posted @ 2015-05-22 22:34 Acjx 阅读(869) 评论(0) 推荐(0) 编辑
摘要: http://www.lintcode.com/zh-cn/problem/topological-sorting/# 给定一个有向图,图节点的拓扑排序被定义为: 对于每条有向边A--> B,则A必须排在B之前 拓扑排序的第一个节点可以是任何在图中没有其他节点指向它的节点 找到给定图的任一拓扑排序 solution Topologi... 阅读全文
posted @ 2015-05-22 21:20 Acjx 阅读(630) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/search-in-rotated-sorted-array-ii/ Follow up for "Search in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity?... 阅读全文
posted @ 2015-05-22 19:18 Acjx 阅读(202) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/search-in-rotated-sorted-array/ Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). Y... 阅读全文
posted @ 2015-05-22 17:03 Acjx 阅读(288) 评论(0) 推荐(0) 编辑
摘要: https://leetcode.com/problems/search-insert-position/ Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inse... 阅读全文
posted @ 2015-05-22 11:57 Acjx 阅读(226) 评论(0) 推荐(0) 编辑