鱼儿慢慢游~~

导航

 

2016年5月25日

摘要: 描述: 其实我没有看到这个题 给定一个数n, 求其全排列。 如3 则输出 [1, 2, 3][1, 3, 2][2, 1, 3][2, 3, 1][3, 1, 2][3, 2, 1] 使用回溯法求解。 使用n维数组visit 来标记一个数是否已经加入集合。回溯树如下: 深度优先搜索,当搜索深度为n时 阅读全文
posted @ 2016-05-25 16:05 miss_UU 阅读(398) 评论(0) 推荐(0) 编辑
 
摘要: 题目描述: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not 阅读全文
posted @ 2016-05-25 10:22 miss_UU 阅读(154) 评论(0) 推荐(0) 编辑
 
摘要: 题目描述: Given n, how many structurally unique BST's (binary search trees) that store values 1...n? For example, Given n = 3, there are a total of 5 uniq 阅读全文
posted @ 2016-05-25 09:12 miss_UU 阅读(161) 评论(0) 推荐(0) 编辑