-
3803
关于非线性离散系统辨识,小波包分析提取振动信号中的特征频率,有小波分析的盲信号处理。( Nonlinear discrete system identification, Wavelet packet analysis to extract vibration signal characteristic frequency, There Wavelet Analysis Blind Signal Processing.)
- 2017-05-08 17:46:22下载
- 积分:1
-
Scalarmodel
Evesen开发的scalarmodel,耦合了集合卡尔曼滤波算法和集合卡尔曼平滑算法(Scalarmodel coupled with Ensembled Kalman Filter and Ensembled Kalman Smoother)
- 2013-10-09 14:00:29下载
- 积分:1
-
SIMPLE2D
关于simple算法,希望站长能够让小弟加入这个学习的行列。(on simple algorithms, hoping to let the younger station to join the ranks of the study.)
- 2006-06-15 18:52:10下载
- 积分:1
-
Galileo_singlefrequency
说明: Galileo单频定位程序,能基于rinex文件实现高精度定位,供编写时参考(Galileo single-frequency positioning program can achieve high-precision positioning based on RINEX file for reference when writing.)
- 2020-07-04 14:20:01下载
- 积分:1
-
0097
高斯正算坐标程序计算高斯投影的正算问题克拉索夫斯基椭球(Gaussian count is calculated coordinates of the Gaussian projection is counting police used batons for dispersing ellipsoid)
- 2005-03-19 09:55:21下载
- 积分:1
-
fft_基2基4基8
说明: 基2基4基8以及分裂基的fft算法,代码效率很高。是难得一见的好代码。应用范围很广。(Radix-2-4-based 8 and split fft-based algorithm, a high code efficiency. Is a rare good code. Application of a very wide scope.)
- 2021-02-20 13:59:43下载
- 积分:1
-
Linearized-Bregman
linearized bregman 用于压缩感知中的稀疏信号恢复(linearized bregman)
- 2011-05-25 18:33:17下载
- 积分:1
-
EuDist2
计算矩阵内空间任意两点之间或者两个矩阵之间的欧式距离的代码。(The space between any two points is calculated matrix code or Euclidean distance between the two matrices.)
- 2021-04-05 14:59:03下载
- 积分:1
-
T_C
在计算流体力学中,多项流中有相变时,基于温度的相变UDF(Mass based on the temperature of the phase change in the UDF)
- 2013-06-29 15:44:16下载
- 积分: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