摘要:
27. 移除元素 题目链接 快慢指针,最终返回index值为移除元素后的数组末尾元素下标+1. #include<vector> using namespace std; class Solution { public: int removeElement(vector<int>& nums, in 阅读全文
posted @ 2023-09-07 21:34
DaxiaWan
阅读(21)
评论(0)
推荐(0)
摘要:
344. 反转字符串 题目链接 #include<bits/stdc++.h> using namespace std; class Solution { public: void reverseString(vector<char>& s) { int len = s.size(); for(in 阅读全文
posted @ 2023-09-07 21:03
DaxiaWan
阅读(48)
评论(0)
推荐(0)
摘要:
哈希表基础知识 哈希表(Hash table)又称散列表,是根据关键码的值而直接进行访问的数据结构 哈希表一般用来快速查询元素a是否在集合B中,O(1)时间复杂度即可做到,枚举的话则是O(n) 哈希函数hashFunction(x):将输入x映射为哈希表上的索引,之后通过查询索引下标即可快速查询x 阅读全文
posted @ 2023-09-07 10:51
DaxiaWan
阅读(51)
评论(0)
推荐(0)

浙公网安备 33010602011771号