list
1 | list<int> list; |
pair
1 | pair<int, int> v = {1, 2} |
stack
1 | stack<int> v; |
deque
1 | deque<pair<int, int>> q; |
1 | from collections import deque |
queue
1 | queue<int> q; |
1 | q=Queue(maxsize=5) # 先进先出 |
heap
1 | int findKthLargest(vector<int>& nums, int k) { |
1 | # https://blog.csdn.net/weixin_43790276/article/details/107741332 |
hash
1 | unordered_map<int, int> ht; |
1 | dic = {} |
sort
1 |
|
1 | # intervals: List[List[int]] |
string sort
1 | sorted_str = ''.join(sorted(strs[i])) |
custom sort
1 | static bool Cmp(vector<int> &v1, vector<int> &v2) { |
1 | from functools import cmp_to_key |