-
IMLS
点云曲面建模,基于距离函数,运用移动最小二乘法,拟合曲面,提取等值面,用于散乱点云的快速三角网格构建(Point cloud surface modeling, based on the distance function, the use of moving least squares method, fitting surface, isosurface extraction for fast scattered point cloud build triangular mesh)
- 2020-11-12 10:09:45下载
- 积分: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
-
counting-the-student-number
统计[0, 100] 之间的学生人数并且求出最值和均值(Statistics [100], the number of students and find the best value and the mean)
- 2012-06-24 21:37:37下载
- 积分:1
-
PANair
面元法程序,用于计算飞行器气动力、气动力矩系数。(panel code for aero calculation.)
- 2020-11-21 11:39:36下载
- 积分:1
-
PatternRecognition3
K均值算法实现二维点的聚类,可以手动选择分的类别数(K mean algorithm for clustering two dimensional points)
- 2018-11-08 18:04:38下载
- 积分:1
-
smallest
这是数值计算当中最小二乘法的例子,在matlab中实现(This is the numerical calculations of the least squares method, for example to achieve Matlab)
- 2006-06-07 23:54:29下载
- 积分:1
-
InToPost
INfix to postfix implementation in java
- 2010-10-10 15:36:06下载
- 积分:1
-
fredholm
第二类Fredholm积分方程的数值解。
所谓积分方程就是积分号内有未知函数的方程(Second numerical solution of Fredholm integral equation)
- 2010-06-19 09:17:01下载
- 积分:1
-
beamformer
通信領域於天線上常運用的波束集成,以matlab寫成。能模擬不同距離造成的波束形狀之不同。也加入部份Dolph-Chebyshev最佳化方法。(A traditional beamformer that can simulate differnt distance from the origin, and some implementation using Dolph-Chebyshev amplitude distribution.)
- 2010-10-17 16:40:40下载
- 积分:1
-
Conjugate-Gradient-Method
共轭梯度法(Conjugate Gradient)是介于最速下降法与牛顿法之间的一个方法,它仅需利用一阶导数信息,但克服了最速下降法收敛慢的缺点,又避免了牛顿法需要存储和计算Hesse矩阵并求逆的缺点,共轭梯度法不仅是解决大型线性方程组最有用的方法之一,也是解大型非线性最优化最有效的算法之一。 在各种优化算法中,共轭梯度法是非常重要的一种。其优点是所需存储量小,具有步收敛性,稳定性高,而且不需要任何外来参数。(Conjugate gradient method (Conjugate Gradient) is between the steepest descent method between the method and Newton' s method, it takes only a first derivative information, but to overcome the steepest descent method convergence slow shortcomings, but also to avoid the Newton method needs to be stored Hesse and disadvantages of computing inverse matrix and the conjugate gradient method is not only one of the most useful methods to solve large linear equations, solution of large-scale nonlinear optimization is one of the most effective algorithm. In various optimization algorithm, conjugate gradient method is a very important one. The advantage is that a small amount of memory required, with step convergence, high stability, and does not require any external parameters.)
- 2017-03-14 15:48:15下载
- 积分:1