toughD
toughD
全部文章
分类
题解(8)
归档
标签
去牛客网
登录
/
注册
toughD的博客
全部文章
(共8篇)
题解 | #三个数的最大乘积#
只需要找到三个最大的和两个最小的就行啦 class Solution { public: /** * 最大乘积 * @param A int整型一维数组 * @param ALen int A数组长度 * @return long长整型 *...
数组
2021-06-14
0
475
题解 | #牛牛的数列#
双向dp class Solution { public: /** * 代码中的类名、方法名、参数名已经指定,请勿修改,直接返回方法规定的值即可 * * * @param nums intvector * @return int ...
2021-06-13
0
345
题解 | #单源最短路#
单调栈,ps单调栈用的最多的就是贪心+单调栈了吧 class Solution { public: vector<vector<int> > foundMonotoneStack(vector<int>& nums) { // wr...
2021-06-13
0
473
题解 | #单源最短路#
有向图就罢了,重边是什么鬼?解法: dijkstra, 时间复杂度:O(V^2) ```class Solution {public: int findShortestPath(int n, int m, vector<vector<int> >& graph)...
2021-06-13
2
509
将升序数组转化为bst
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * ...
平衡二叉搜索树
二叉树
数组
2021-03-26
0
494
二叉树的之字形层序遍历
/** * struct TreeNode { * int val; * struct TreeNode *left; * struct TreeNode *right; * }; */ class Solution { public: /** * ...
2020-12-08
0
573
单链表的排序
/** * struct ListNode { * int val; * struct ListNode *next; * }; */ class Solution { public: /** * * @param head ListNode类 ...
2020-12-07
1
503
出现次数的TopK问题
#include <unordered_map> class Solution { public: /** * return topK string * @param strings string字符串vector strings * @param ...
堆
topk
2020-12-07
2
716