摘要: #include<iostream> using namespace std; struct ListNode { int val; ListNode *next; ListNode(int x) : val(x), next(nullptr) { } }; class Solution { pub 阅读全文
posted @ 2020-12-26 22:50 不妨不妨,来日方长 阅读(97) 评论(0) 推荐(0) 编辑
摘要: #include<iostream> #include<unordered_map> #include<vector> using namespace std; class Solution { public: vector<int> twoSum(vector<int>& nums, int ta 阅读全文
posted @ 2020-12-26 22:25 不妨不妨,来日方长 阅读(68) 评论(0) 推荐(0) 编辑
摘要: 一、最基本的二分查找,判断一个数在数组中是不是存在的问题 #include<iostream> #include<vector> using namespace std; int binary_search(vector<int>& arr, int left, int right, int tar 阅读全文
posted @ 2020-12-26 21:46 不妨不妨,来日方长 阅读(90) 评论(0) 推荐(0) 编辑