标签: 算法
-
60. Permutation Sequence
The set [1,2,3,…,n] contains a total of n! unique per…
-
81. Search in Rotated Sorted Array II
Suppose an array sorted in ascending order is rotated a…
-
75. Sort Colors
Given an array with n objects colored red, white or blu…
-
PAT A1066
平衡二叉树AVL,写过总结,这里不再赘述; {代码…}
-
79. Word Search
Given a 2D board and a word, find if the word exists in…
-
PAT A1064
这道题自己起先想到的思路是根据完全二叉树性质,找出左右子树,递归进行;但是示例给出的思想很值得学习;对于一个二…
-
PAT A1099
和完全二叉排序树那道题类似,采用的方法还是中序遍历空树填节点的方法;代码如下: {代码…}
-
PAT A1043
简单的不用考虑平衡的二叉查询树;我发现我有读题障碍症。。。 {代码…}
-
90. Subsets II
Given a collection of integers that might contain dupli…
-
时间复杂度与空间复杂度分析
作为开发人员,我们都希望在完成功能的基础上让代码运行的更快、更省空间,那如何衡量编写的代码是否更有效率,这就需…