-
6.5M2
偏微分方程的数值解法,简单的离散 变分以及求解过程(Numerical solution of partial differential equations, the simple and the solution process of discrete variational)
- 2011-08-15 19:58:51下载
- 积分:1
-
Density_Estimation
分别采用GMM和KDE对Iris数据集进行密度建模,并进行对比。通过EM算法来确定GMM参数,通过交叉验证来确定K值(GMM and KDE respectively Iris data set of density modeling, and compared. GMM by EM algorithm to determine the parameters of K determined by the value of cross-validation)
- 2011-05-05 10:37:48下载
- 积分:1
-
Wdisp
Wdisp,是基于建造结构计算软件pkpm的结果数据提取文件,方便使用,提取数据后,可用于绘制曲线。(Wdisp, is based on The construction structure calculations software pkpm the results of data extraction files, easy to use, extract data, can be used to draw the curve.)
- 2013-04-08 15:34:48下载
- 积分:1
-
hPSO
hybrid particle swarm optimization
- 2016-09-16 22:36:56下载
- 积分:1
-
solver_direct_turbulent
CFD数值计算中kw-sst两方程湍流模型的相关代码(kw-sst two equation turbulence model of CFD numerical calculation)
- 2021-04-29 18:28:42下载
- 积分:1
-
Monte-Carlo
详细全面的蒙特卡洛PPT讲解以及MATLAB算例,帮助大家0基础快速掌握MC的精华所在。(Detailed and comprehensive Monte Carlo PPT to explain and MATLAB example, to help you basically grasp the essence of MC.)
- 2021-03-09 15:09:27下载
- 积分:1
-
xianxingchazhi
本程序可用于线性插值,Fortran源码用于插值计算。(Program for linear interpolation.)
- 2015-12-15 14:05:52下载
- 积分:1
-
3D-fdtd
三维的有限时域差分源程序,边界条件为pml(Three-dimensional FDTD source, boundary conditions for the PML)
- 2020-11-06 21:39:49下载
- 积分:1
-
11087 统计逆序对
说明: Description
设a[0…n-1]是一个包含n个数的数组,若在ia[j],则称(i, j)为a数组的一个逆序对(inversion)。
比如 有5个逆序对。请采用类似“合并排序算法”的分治思路以O(nlogn)的效率来实现逆序对的统计。
一个n个元素序列的逆序对个数由三部分构成:
(1)它的左半部分逆序对的个数,(2)加上右半部分逆序对的个数,(3)再加上左半部分元素大于右半部分元素的数量。
其中前两部分(1)和(2)由递归来实现。要保证算法最后效率O(nlogn),第三部分(3)应该如何实现?
此题请勿采用O(n^2)的简单枚举算法来实现。
并思考如下问题:
(1)怎样的数组含有最多的逆序对?最多的又是多少个呢?
(2)插入排序的运行时间和数组中逆序对的个数有关系吗?什么关系?
输入格式
第一行:n,表示接下来要输入n个元素,n不超过10000。
第二行:n个元素序列。
输出格式
逆序对的个数。
输入样例
5
2 3 8 6 1
输出样例
5(Set a[0... N-1] is a n array containing n numbers. If there is a [i] > a [j] i n the case of I < j, then (i, j) is a n inversion pair of a array.
For example, has five reverse pairs. Please use the idea of "merge sorting algorithm" to achieve the statistics of inverse pairs with O (nlogn) efficiency.
The number of inverse pairs of a sequence of n elements consists of three parts:
(1) The number of reverse pairs in the left half, (2) the number of reverse pairs in the right half, (3) the number of elements in the left half is greater than that in the right half.
The first two parts (1) and (2) are implemented by recursion. To ensure the final efficiency of the algorithm O (nlogn), how should the third part (3) be implemented?
Do not use O (n ^ 2) simple enumeration algorithm to solve this problem.)
- 2019-01-07 23:52:06下载
- 积分:1
-
fit2
最小二乘曲面拟合程序(m文件),对一组三维数据z=f(x,y)拟合,成为关于x和y的多项式(least squares fitting procedure Surface (m), a group of three-dimensional data z = f (x, y) fitting, be on the x and y polynomial)
- 2021-04-22 16:08:48下载
- 积分:1