https://oj.leetcode.com/problems/insertion-sort-list/插入排序为假设[0,i)已经为有序数组,下一步从[i,n)找最小的元素交换到i处。用指针模拟这个过程即可。就是操作有些麻烦。每次[head,p)为已经有序的数组,下次从[p,tail]找出最小的...
分类:
编程语言 时间:
2014-10-11 01:46:54
阅读次数:
327
11991 - Easy Problem from Rujia Liu?Time limit: 1.000 secondsProblem EEasy Problem from Rujia Liu?Though Rujia Liu usually sets hard problems for cont...
分类:
其他好文 时间:
2014-10-10 22:51:14
阅读次数:
239
https://oj.leetcode.com/problems/next-permutation/我这个解法并不很好,是O(n^2),这个在STL实现里应该是O(n)的。不过我的方法比较简单。想法是首先需要找到一个left边界l,这个边界需要跟其后面的某个元素r交换使序列增大。然后在l前面的部分不...
分类:
编程语言 时间:
2014-10-10 22:39:24
阅读次数:
177
原题地址:https://oj.leetcode.com/problems/distinct-subsequences/题意:Given a stringSand a stringT, count the number of distinct subsequences ofTinS.A subseq...
分类:
编程语言 时间:
2014-10-08 00:56:04
阅读次数:
262
dynamic programming related problems......
分类:
其他好文 时间:
2014-10-07 22:58:14
阅读次数:
291
原题地址:https://oj.leetcode.com/problems/best-time-to-buy-and-sell-stock-iii/题意:Say you have an array for which theithelement is the price of a given sto...
分类:
编程语言 时间:
2014-10-06 23:54:02
阅读次数:
266
Description
Little jay really hates to deal with string. But moondy likes it very much, and she's so mischievous that she often gives jay some dull problems related to string. And one day, moondy g...
分类:
其他好文 时间:
2014-10-05 15:19:28
阅读次数:
279
https://oj.leetcode.com/problems/minimum-window-substring/线性复杂度的限制下,考虑使用滑动窗口法。这个方法的思路就是维持一个窗口,窗口向右边界扩张以满足限制条件。窗口左边界收缩以尽量使其最小。注意这个题目可能是一个典型的滑动窗口方法的实现。外...
UVa特别题库
UVa网站专门为本书设立的分类题库配合,方便读者提交:
http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=442
注意,下面注有“extra”的习题并没有在书中出现,但在上面的特别题库中有,属于附加习题。
基础练习 (Basic Problems)
...
分类:
其他好文 时间:
2014-10-03 09:56:44
阅读次数:
259