LeetCode on the way, two sum
完整代码如下
使用Hash表(时间复杂度为O(1),但是需要建立Hash表,以空间换时间!)
有两种使用Hash表的方法,第一种为:
#include <iostream>
#include <unordered_map>
#include <vector>
using namespace std;
class Solution
{
publi...
原创
2017-07-03 00:47:40 ·
304 阅读 ·
0 评论