给定一个大小为n≤106<?XML:NAMESPACE PREFIX = "[default] http://www.w3.org/1998/Math/MathML" NS = "http://www.w3.org/1998/Math/MathML" />n≤106的数组。有一个大小为k的滑动窗口, ...
分类:
其他好文 时间:
2020-07-26 19:28:57
阅读次数:
56
#include<algorithm> #include<iostream> #include<cstdlib> #include<cstring> #include<cctype> #include<cstdio> #include<vector> #include<string> #includ ...
分类:
其他好文 时间:
2020-07-26 19:19:47
阅读次数:
69
考察二叉树的遍历。判断前序遍历,与新增的前->右->左遍历结果是否一致。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义二叉树 struct TreeNode{ int val; struct Tree ...
分类:
其他好文 时间:
2020-07-26 01:57:55
阅读次数:
63
问题: 给定一个int数组A,数组中元素互不重复,给定一个数x,求所有求和能得到x的数字组合,组合中的元素来自A,可重复使用。 #include<iostream> #include<vector> #include<algorithm> using namespace std; void getS ...
分类:
其他好文 时间:
2020-07-26 01:53:45
阅读次数:
111
考察链表的操作,合并两个有序链表,合并后的链表仍是有序的。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* ne ...
分类:
编程语言 时间:
2020-07-26 01:33:46
阅读次数:
65
类型:有关素数的基础算法 思路:埃氏筛选 AC代码: #include<iostream> #include<cstring> #include<algorithm> using namespace std; const int MAX_N=10000000; int prime[MAX_N]; b ...
分类:
其他好文 时间:
2020-07-26 01:30:40
阅读次数:
73
In this note,you will not find the concept of QS and the method of how to compute the cost of time and space of this algorithm。This page will not refe ...
分类:
其他好文 时间:
2020-07-26 01:23:01
阅读次数:
76
考察二叉树的遍历。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义二叉树 struct TreeNode{ int val; struct TreeNode* left; struct TreeNode ...
分类:
其他好文 时间:
2020-07-26 01:18:59
阅读次数:
54
考察链表的操作,找到单向链表中环的入口节点 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* next; List ...
分类:
其他好文 时间:
2020-07-26 00:49:30
阅读次数:
60
考察链表的操作,注意使用一次遍历。相关题目:求链表的中间节点。 C++版 #include <iostream> #include <algorithm> using namespace std; // 定义链表 struct ListNode{ int val; struct ListNode* ...
分类:
其他好文 时间:
2020-07-26 00:41:33
阅读次数:
55