在分享面经的查理很喜欢走神
在分享面经的查理很喜欢走神
全部文章
题解
八股文(1)
未归档(6)
归档
标签
去牛客网
登录
/
注册
个人学习笔记
学习记录
全部文章
/ 题解
(共5篇)
剑指offer-搜索算法
1.数字在升序数组中出现的次数 实现函数lower_bound和upper_bound int GetNumberOfK(vector<int> nums ,int k) { if (nums.empty()) return 0; int n = ...
C++
2022-03-13
0
304
剑指offer-回溯
1.矩阵中的路径 class Solution { int dx[4] = {0, -1, 0, 1}, dy[4] = {1, 0, -1, 0}; bool dfs(vector<vector<char>>& matrix, int x, int ...
C++
深度优先搜索
广度优先搜索
2022-03-11
0
279
剑指offer-排序
1.数组中重复的数字 使nums[i] = i;交换不动了就是重复的数字。 int duplicate(vector<int>& nums) { for (int i = 0; i < nums.size(); ++i) { ...
C++
归并排序
分治
2022-03-11
0
314
剑指offer-队列&栈
1.用两个栈实现队列 实现一个函数:将一个栈倒腾到另外一个栈。 class Solution { void inToOut() { if (out.empty()) { while (in.size()) { int n...
C++
栈
队列
2022-03-11
0
341
链表
2.反转链表 头插法形成一个环形的指向 ListNode* ReverseList(ListNode* pHead) { ListNode* dummy = nullptr; auto cur = pHead; auto curNext = c...
C++
链表
2022-03-11
0
431