-
Moving-Least-Square-Method
用于多学科设计优化中代理模型技术,移动最小二乘法是代理模型方法的一种(For multidisciplinary design optimization in the agent model, the moving least squares method is a kind of agent model)
- 2020-11-12 09:39:43下载
- 积分:1
-
11087 统计逆序对
Description
设a[0…n-1]是一个包含n个数的数组,若在i<j的情况下,有a[i]>a[j],则称(i, j)为a数组的一个逆序对(inversion)。
比如 <2,3,8,6,1> 有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, <2,3,8,6,1> 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
-
mt_1d
这是大地电磁一维正演程序,只要输入电阻率和深度即可正演计算;使用的是卡尼亚视电阻率公式,有关说明已经在文件中说明。(This is a one-dimensional magnetotelluric forward the program, as long as the input resistivity and depth to forward calculation use Carney ATV resistivity formula, and instructions in the file description.)
- 2012-04-07 11:31:31下载
- 积分:1
-
FRFT-suanfa
这是学习分数阶傅里叶变换,必须的算法这是学习分数阶傅里叶变换,必须的算法这是学习分数阶傅里叶变换,必须的算法(the of fragnaii or fft)
- 2021-04-27 22:48:44下载
- 积分:1
-
运算复数
计算方法中的复数运算(calculation method in the plural Operational)
- 2005-01-26 15:25:21下载
- 积分:1
-
gcc-objc-3.4.2-20040916-1.tar
The Polarized light Monte Carlo programs described here keep track of the status of polarization of light traveling through a scattering media.(polarized monte carlo)
- 2021-04-11 09:58:58下载
- 积分:1
-
tron-1.2.tar
用Fortran编写的非线性优化软件,具有一定的智能搜索功能(used in Fortran program)
- 2012-04-24 18:45:48下载
- 积分:1
-
udf-fluent
说明: fluent 二次开发,udf编程参考,c语言编程(Fluent udf coding c language multiphase flow)
- 2020-12-29 09:09:01下载
- 积分:1
-
FDTD
说明: 利用时域有限差分计算电磁场,采用时域算法计算(Calculation of electromagnetic field by FDTD)
- 2020-10-16 23:21:59下载
- 积分:1
-
utmc
本程序用于生成高质量的网格,可用于有限元,有限体积等方法的前处理。(This procedure is used to generate high-quality mesh, can be used for finite element, finite volume methods such as pre-processing.)
- 2017-08-10 11:24:49下载
- 积分:1