3-SUM问题的平方级时间复杂度实现
目录
本题为《算法4》作者 Robert Sedgewick 和 Kevin Wayne 在 Cursera 上开设的公开课的习题解答,本题出自以下地址中的课后题。
原题
3-SUM in quadratic time. Design an algorithm for the 3-SUM problem that takes time proportional to n2 in the worst case. You may assume that you can sort the n integers in time proportional to n2 or better.
Note: these interview questions are ungraded and purely for your own enrichment. To get a hint, submit a solution.
解题
|
|