搜索资源列表
最短距离问题
- 求解网络中的最短路径。假设某个计算机网络有n个站点,依次编号为1,2,…,n;有的站点之间有直接的线路连接(即这两个站点之间没有其它站点),有的站点之间没有直接的线路连接。如果用三元组(i,j,f)来表示该网络中的站点I和站点j之间有直接的线路连接且它们之间的距离为f 当已知该网络各站点之间的直接连接情况由m个三元组(i1,j1,f1),(i2,j2,f2),…,(im,jm,fm)确定时,要求计算出对于网络中任意一个站点g(1≤g≤n)到其余各站点的最短距离。-the shortest pat
int dfsSweep
- 深度搜索算法,求解从起源点s到点j的最短路径算法的基本过程-depth search algorithm, solved from the point of origin j s close of the shortest path algorithm for the basic process
graphic_algorithm
- 每对节点间最短路径 Floyd-Warshall 算法 D[i,j]表示从i到j的最短距离; P[i,j]表示从i到j的最短路径上j 的父节点-between each pair of nodes Shortest Path Floyd-Warshall algorithm D [i, j] said from i to j is the shortest distance; P [i, j] said from i to j the shortest path
Strassen11
- 矩阵相乘的Strassen算法,其中 乘积矩阵C = H*H,H =(hij)n*n 1. hij = , i,j=1,…8 2. i,j=1,…12 矩阵H =(hij)n*n自动生成,取小数点后面6位计算 -Strassen matrix multiplication, the algorithm, the product matrix C = H * H, H = (hij) n * n 1. hij =, i, j = 1, ... 2. i, j = 1, ...
lqx10004
- 最小重量机器设计问题 设某一机器由n个部件组成,每一种部件都可以从m个不同的供应商处购得。设w(i,j)是从供应商j处购得的部件i的重量,C(i,j)是相应的价格。 设计一个优先列式分支限界法,给出总价格不超过c的最小重量机器设计。-minimum weight machines based design of a machine n components, each component can be 000 m from different vendors purchased. L
FJS
- 按作业效益非增序输入作业的截止期限,要求使用上述规则设计出一个算法,使得输出为一个作业可行集j[]。即如果作业i可以在截止期限前执行完毕则将其加入j[]。这样得出的一个结果是最优解,可以获得最大的效益值。-operating efficiency by increasing non-operating input sequence that the deadline for requests to use these rules to design a lgorithm, the output
shorttest_path_program
- 有N个城市,编号为0、1…N-1,每个城市之间的路径长度保存在二位数组a中,如a[i][j]表示城市i与城市j的路径长度。求某个城市到其余城市的最短路径。-cities are N, No. 0,1 ... N-1, every city path length between the two kept in a group median, if a [i] [j] i said cities and urban j length of the path. For a city to the o
euler.cpp
- 有时仅对赋权有向图上从任意一个顶点到另外任意一个顶点之间有没有路感兴趣。试修改Floyd算法,计算出图的道路矩阵P,使得从顶点i到顶点j有路时P[i,j]= 1,否则P[i,j]= 0。-sometimes only to empower a map from any one vertex to another arbitrary point between a road not interested. Try to amend Floyd algorithm calculated the ro
zsum
- 给定n 个整数a ,a , ,an 1 2 组成的序列, a n i | |£ ,1 £ i £ n。如果对于i £ j ,有 0 = å = j k i k a ,则称序列区间i i j a , a , , a +1 为一个零和区间,相应的区间长度为j-i+1。-given n integers a, a, and an 1 2
dia
- 给定n 个整数a ,a , ,an 1 2 组成的序列, a n i | |£ ,1 £ i £ n。如果对于i £ j ,有 0 = å = j k i k a ,则称序列区间i i j a , a , , a +1 为一个零和区间,相应的区间长度为j-i+1。-given n integers a, a, and an 1 2
sushudui
- 编制函数prime,用来判断整数n是否为素数:bool prime(int n); 而后编制主函数,任意输入一个大于4的偶数n,找出满足n=i+j的所有数对,其中要求i与j均为素数(通过调用prime来判断素数)。如偶数18可以分解为11+7以及13+5;而偶数80可以分解为:43+37、61+19、67+13、73+7。-establishment prime function, used to judge whether the integer n is prime : bool prime
Bala
- 给定n个整数a , a , ,an 1 2 组成的序列。序列中元素i a 的符号定义为: ï î ï í ì - < = > = 1 0 0 0 1 0 sgn( ) i i i i a a a a 符号平衡问题要求给定序列的最长符号平衡段的长度L,即: þ ý ü î í ì = + - = å =
POJ2104
- 高效求一超大数组中第i个元素到第j个元素间第k小的元素.
ZuiChangGongGongZiXuLie
- 问题描述 序列Z=<B,C,D,B>是序列X=<A,B,C,B,D,A,B>的子序列,相应的递增下标序列为<2,3,5,7>。 一般地,给定一个序列X=<x1,x2,…,xm>,则另一个序列Z=<z1,z2,…,zk>是X的子序列,是指存在一个严格递增的下标序列〈i1,i2,…,ik〉使得对于所有j=1,2,…,k使Z中第j个元素zj与X中第ij个元素相同。 给定2个序列X和Y,当另一序列Z既是X的子序列又
huisu
- out< \"please input the number of the nodes\"<<endl cin>>nodesNum cout<<\"please input the graph\"<<endl for( i = 1 i<=nodesNum i++) for( j = 1 j <= nodesNum j++) cin>>graph[i][j] */
mypoint
- 若在矩阵Am×n中存在一个元素A[i-1,j-1],其满足A[i-1,j-1]是第i行元素中最小值,且又是第j列元素中最大值,则称此元素为该矩阵的一个马鞍点。用二维数组存储矩阵Am×n ,设计算法求出矩阵中所有马鞍点。
wu
- 给定n个小区之间的交通图。若小区i与小区j之间有路可通,则将顶点i与顶点j之间用边连接,边上的权值 表示这条道路的长度。现在打算在这n个小区中选定一个小区建一所医院。试问这家医院应建在哪个小区,才能使距离医院最远的小区到医院的路程最短?请设计一个算法求解上述问题。
AC
- 多模式匹配算法——AC算法 参考文献:AC算法:Aho A V,Corasick M J.Efficient string matching:an aid to bibliographic search.Communications of ACM,1975,18(6):333~340
maandian
- 找马鞍点:1. 若在矩阵Am×n中存在一个元素A[i][j],其满足A[i][j]是第i行元素中最小值,且又是第j列元素中最大值,则称此元素为该矩阵的一个马鞍点。用二维数组存储矩阵Am×n ,设计算法求出矩阵中所有马鞍点。-Find a saddle point: 1. If in the matrix Am × n, there is a element of A [i] [j], the meet A [i] [j] is the first line element in the mini
Leo-J.-Guibas-
- 红黑树的c源码实现与剖析,用c语言完整实现过红黑树,但个人感觉,代码还是不够清晰。特此,再奉献出一份c++的完整实现源码,以飨读者。-Leo J. Guibas
