-
network-immune-system
非线性微分方程的人工免疫网络数学模型,适合于高水平研究者(Nonlinear differential equation mathematical model of artificial immune network, suitable for high-level researchers)
- 2011-10-18 11:27:43下载
- 积分:1
-
big-intger-plus-minus-multiply
C语言实现大数的加法减法以及乘法,水平限于仅仅大学生水平学习使用。(Use C language to achieve that addition, subtraction, and multiplication of a big intger.)
- 2013-05-11 13:52:20下载
- 积分: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
-
Project10
采用数值分析课程中的插值逼近以及曲面拟合方法来估算复杂的函数表达式。(Interpolation approximations and surface fitting methods are used in the numerical analysis course to estimate complex function expressions.)
- 2016-12-20 10:08:03下载
- 积分:1
-
T_C
在计算流体力学中,多项流中有相变时,基于温度的相变UDF(Mass based on the temperature of the phase change in the UDF)
- 2013-06-29 15:44:16下载
- 积分:1
-
Project9
用于求解超定方程组最小二乘解,稳定性高,速度快(To get the least square solution of
superlattice dislocation.)
- 2016-12-29 22:41:03下载
- 积分:1
-
插值与函数逼近
说明: 分段三次Hermite插值法 样条插值 切比雪夫最佳一致逼近 Legendre、 Laguerre、Hermite多项式主函数 牛顿 插值(Piecewise cubic Hermite interpolation)
- 2020-10-05 17:35:23下载
- 积分:1
-
LU_Matrix_1.c
lu分解矩阵求逆...
===========
紫薯紫薯...(Matrix LU decomposition inversion)
- 2020-06-18 07:40:02下载
- 积分: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
-
CSAMT_1D_forword
一维CSAMT正演程序,对学地球物理的有帮助(CSAMT)
- 2021-04-16 17:58:54下载
- 积分:1