-
fast-descent
牛顿法测试程序,包含线搜索和不含线搜索时算法比较。(newton algorithm with linear and without linear search.)
- 2020-12-02 22:59:24下载
- 积分: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
-
dlzd
本程序是用节点导纳矩阵计算三相短路电流
输入数据--形成节点阻抗矩阵--选择故障点---计算短路电流----计算个节点电压---计算指定支路的电流(this procedure is used node admittance matrix calculation of three-phase short-circuit current input data-- forming node impedance matrix-- election Optional fault--- calculation of short-circuit current-voltage computing nodes designated calculated slip road--- Electricity)
- 2006-06-08 17:38:48下载
- 积分:1
-
ai463
用蒙特卡洛模拟的方法计算美式期权的价格以及基本描述,能量熵的计算,sar图像去噪的几种新的方法。( Monte Carlo simulation method of calculating the American option price and basic description, Energy entropy calculation, Several new methods sar image denoising.)
- 2017-05-05 20:24:01下载
- 积分:1
-
1
说明: 利用有限差分法求解雷诺方程,进而可以求解气体静压轴承的特性(The Reynolds equation is solved by the finite difference method, and the characteristics of aerostatic bearing can be solved.)
- 2018-05-19 18:05:08下载
- 积分:1
-
Writing a UMAT
主要用来进行Umat子程序指导编程说明用的文件(The document is mainly used for writting a Umat project by fortran language.)
- 2017-11-20 21:37:56下载
- 积分:1
-
multable
java编写九九乘法表
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
5*1=5 5*2=10 5*3=15 5*4=20 5*5=25
6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36
7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49
8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64
9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81
(Multiplication table
1*1=1
2*1=2 2*2=4
3*1=3 3*2=6 3*3=9
4*1=4 4*2=8 4*3=12 4*4=16
5*1=5 5*2=10 5*3=15 5*4=20 5*5=25
6*1=6 6*2=12 6*3=18 6*4=24 6*5=30 6*6=36
7*1=7 7*2=14 7*3=21 7*4=28 7*5=35 7*6=42 7*7=49
8*1=8 8*2=16 8*3=24 8*4=32 8*5=40 8*6=48 8*7=56 8*8=64
9*1=9 9*2=18 9*3=27 9*4=36 9*5=45 9*6=54 9*7=63 9*8=72 9*9=81
)
- 2012-11-29 08:29:51下载
- 积分:1
-
matlabFunctions
说明: 在matlab实现基于Schmidt的QR分解,共轭梯度法等(QR decomposition based on Schmidt in MATLAB)
- 2020-01-13 11:19:51下载
- 积分:1
-
element-rigid-matrix
单元刚度矩阵,用于计算三单元刚度矩阵,输出刚度矩阵(Element stiffness matrix is used to calculate the three-element stiffness matrix, the output stiffness matrix)
- 2012-06-12 17:18:33下载
- 积分:1
-
GPKolmogorov
This file contains a summary of what you will find in each of the files that
make up your GPKolmogorov application.
- 2008-03-27 22:07:01下载
- 积分:1