-
glmnet_matlab
Lasso算法源代码,stanford开发的,绝对可靠(Glmnet for Matlab- Lasso (L1) and elastic-net regularized generalized linear models)
- 2012-09-01 18:52:52下载
- 积分:1
-
kpca
KPCA是一种非线性的盲源分离方法,很好用,推荐大家下载!(KPCA is a nonlinear blind source separation methods, very good, and recommend everyone to download!)
- 2020-12-03 14:29:25下载
- 积分:1
-
szfx
数值分析里面的:不动点迭代法、牛顿迭代法、共轭梯度法和最速下降法(Conjugate Gradient)
- 2015-11-18 14:08:22下载
- 积分:1
-
Delany_Bazley
纤维状多孔材料的D_B吸声模型,用于计算高孔隙率的刚性多孔材料的吸声系数(D_B absorption model fibrous porous material for sound absorption coefficient high porosity rigid porous material)
- 2021-03-13 10:09:25下载
- 积分:1
-
jisaunerchongjifen
求解任意区域上的二元函数的二重积分,功能强大实用方便!(Solving binary function on any area of the double integral, powerful practical and convenient!)
- 2013-06-06 10:32:44下载
- 积分:1
-
Rect-column
此程序用于计算矩形截面的弯矩曲率特性以及不同极限状态的识别(This program is used to calculate the moment curvature characteristic of the rectangular cross-section, and the identification of different limit state)
- 2020-11-02 22:09:58下载
- 积分:1
-
实验1
利用不动点迭代和牛顿迭代求解非线性方程解的理论(Theory of Solving Nonlinear Equations by Fixed Point Iteration and Newton Iteration)
- 2019-05-07 16:56:30下载
- 积分: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
-
juzhenqiuni
网上看到很多关于矩阵求逆运算的代码,都很杂很乱,我把代码重新真理了一边,可以直接编译运行(See a lot of online matrix inversion code, very complex mess, I put the code back to the side of truth, you can directly compile and run)
- 2010-12-11 16:28:34下载
- 积分:1
-
2d-MT-finite-element-forward-
改程序用于大地电磁法二维有限元法正演模拟(Reform program for the magnetotelluric method of two-dimensional finite element method for forward modeling)
- 2021-02-09 10:49:53下载
- 积分:1