与BFS不同的是每条路径多
原创 2022-11-22 13:34:35
160阅读
Manachar’s AlgorithmLongest palindromic substring - Wikipedia  https://en.wikipedia.org/wiki/Longest_palindromic_substringLongest palindromic substringFrom Wikipedia, the free encyclopedia   Jump to n
转载 2020-12-30 01:11:00
83阅读
2评论
Kadane's Algorithmis anO(n)algorithm for finding the maximum contiguoussubsequencein a one-dimensionalsequence.[edit]PseudocodeThe algorithm keeps track of the tentative maximum subsequence in(maxSum, maxStartIndex, maxEndIndex). It accumulates a partial sum incurrentMaxSumand updates the optima
转载 2013-04-13 12:27:00
86阅读
2评论
TCP Nagle’s Algorithm
原创 2022-10-28 09:09:27
140阅读
://noisy.network/2017/02/06/delayed-ack-and-nagles
转载 2022-02-23 10:47:51
263阅读
An Attempt to Understand Boosting Algorithm(s)WELCOME!Here you will find dailynews and tutorials about R, contributed by over 573 bloggers.There are m...
转载 2015-06-27 19:20:00
56阅读
w非全尺寸分组的发送条件 HTTP The Definitive Guide TCP has a data stream interface that permits applications to stream data of any size to the TCP stack—even a si
转载 2017-02-04 16:05:00
222阅读
2评论
Algorithm】Sorting Algorithm 目录 对比排序 冒泡排序Bubble Sort 归并排序Merge Sort 快速排序Quick Sort 线性排序 计数排序Count Sort 桶排序Bucket Sort 对比排序 Bubble Sort /* * 冒泡排序:重复得走过 ...
转载 2021-10-10 19:39:00
121阅读
2评论
"Link" 先对$y$分治分治,考虑$y\in[l,mid]$的红点和$y\in(mid,r]$的蓝点的贡献。 一个很显然结论是:可能出现在答案中的点对中,至少有一个点是在该$y$坐标范围内该颜色点中权值最大的点。 那么这样我们就可以求出$O(n\log n)$对可能对答案有影响的点对。 然后对两
转载 2020-04-29 10:34:00
57阅读
2评论
You may refer to the main idea of MST in graph theory.http://en.wikipedia.org/wiki/Minimum_spanning_tree Here is my own interpretationWhat is Minimum Spanning
转载 2013-07-09 15:40:00
74阅读
15点赞
2评论
For example we have the array like this: First step is using Counting sort for last digit, in our example is: Then sort according to the last digit: T
转载 2019-03-14 15:45:00
101阅读
2评论
冒泡排序def bubble_sort(li): for i in range(len(li)-1): # i表示第几趟 for j in range(len(li)-i-1): # j表示图中的箭头 if li[j] > li[j+1]: li[j], li[j+1] = li[j+1], li[j] ===
转载 2023-08-08 13:05:47
82阅读
经过慎重考虑,也经过反复思考。查阅网上相关资料 1 一位高手对我的建议: 2 一般要做到50行以内的程序不用调试、100行以内的二分钟内调试成功.acm主要是考算法的 3 ,主要时间是花在思考算法上,不是花在写程序与debug上。 4 下面给个计划你练练: 5 6 第一阶段: 7 ...
转载 2015-05-23 09:56:00
80阅读
2评论
#include <iostream>#include<algorithm>using namespace std;bool cmp(int a,int b){ return a>b;}int main(){ int a[4]={2,9,3,1}; do{ for(int i=0;i<4;i++) cout<<a[i];...
原创 2021-06-11 10:04:32
176阅读
#include <iostream> #include<algorithm> using namespace std; bool cmp(int a,int b) { return a>b; } int main() { int a[4]={2,9,3,1}; do{ for(int i=0;i<4;i++) cout<<a[i]; ...
原创 2022-03-02 11:20:07
49阅读
Introduce What is Algorithm? 算法是求解问题的*步骤*** 算法的特性 有穷性:一个算法必须在有穷步后结束,每一步必须在有穷时间内完成 算法有穷而程序无穷 确定性:每条指令不能有歧义,即无论运行多少次,相同的输入总能得到相同的输出 可行性:算法中描述的操作都可以通过已经实 ...
转载 2021-03-29 22:18:00
443阅读
2评论
S.No. Name Indexing Search Insertion Optimized Search 1 Linear Array O(1) O(n) N/A O(log n) 2 Dynamic Array O(1) O(n) O(n) O(log n) 3 Linked List O(n) O(n) O(1) O(n) 4 Hash Table O(1) O(1) O(1) ------
原创 2021-09-08 10:13:21
198阅读
前言 用的不熟练千万别用。 前置芝士:链式前向星 这玩意是个啥呢?先别着急,先上代码,再慢慢讲。 int head[MAXN]; struct Node{//定义 long long to/*终点*/,dis/*权值*/,next/*上一个next的下标*/; }edge[3000001]; voi ...
转载 2021-07-16 15:00:00
55阅读
2评论
迪杰斯特拉算法是典型的求解最短路径的方法。优点,时间复杂度为O(n2),主要思想就是遍历邻居,找到路径最短的邻居,添加到路径信息里面。再更新这个添加点,是否能减少到其他点的路径长度。但是有一个缺点,就是这个算法只满足一个节点的扫描信息,如果想计算所有的节点到达其他节点的最短路径,就需要每次调用一次该算法。时间复杂度变为O(n3).总体来说,分为两部分第一部分:查找当前节点周围的最近的邻居;min = INF; for(j=0; j 2 #include 3 #define MAXSIZE 9 4 #define INF 65535 5 int num[MAXSIZE][M...
转载 2014-03-12 21:16:00
60阅读
2评论
Dijkstra 思路:每一次枚举当前没有枚举过的 值最小的点 ,然后对该结点进行
原创 2022-11-03 15:23:05
73阅读
  • 1
  • 2
  • 3
  • 4
  • 5