fancycarp
fancycarp
全部文章
分类
题解(44)
归档
标签
去牛客网
登录
/
注册
fancycarp的博客
全部文章
(共44篇)
NC140 #排序#
正好复习一下快速排序:一定不要忘记加&!!!!!忘加了就寄了 class Solution { public: void swap(vector<int>& arr, int a, int b) { int temp = arr[a]; ...
递归
排序
2021-05-05
0
440
NC61#两数之和#
思路:遍历一边数组,每遇到一个先看看target - numbers[i]在不在map里,在的话就返回结果,不在的话就把(numbers[i], i)放入map中。 class Solution { public: /** * * @param numbers int整...
2021-05-05
1
611
NC119 #最小的K个数#
思路一:先排序,后取前k个数。 class Solution { public: vector<int> GetLeastNumbers_Solution(vector<int> input, int k) { vector<int> re...
2021-05-04
0
606
NC78 #反转链表#
解法一:双指针注意点:left要初始化为NULL class Solution { public: ListNode* ReverseList(ListNode* pHead) { ListNode* left = NULL, *right = pHead; ...
递归
链表
双指针
2021-05-04
0
531
首页
上一页
1
2
3
4
5
下一页
末页