-
MatricInvers
求给定矩阵的逆矩阵和行列式值。已经经过测试,与matlab做了对比,计算结果可靠(Seeking a given matrix inverse matrix and determinant value. Has been tested with Matlab contrast, reliable calculation results)
- 2012-11-12 17:36:51下载
- 积分:1
-
wenjian
汽车油耗计算(C实现)对于家用经济型小轿车来说,统计油耗是经常做的一件事。本题目要求根据汽油单价、每次加油所用钱数,以及该次加的油所跑里程数计算出该车的百公里油耗,并进行保存,根据需要给出统计数据。(Vehicle fuel consumption calculation (C implementation) for the household economy cars, the fuel consumption statistics is often one of the things. The questions asked based on gasoline price, amount of money each fuel used, and the second oil added to calculate the mileage run car 100 km fuel consumption, and save, according to the need to give statistics.)
- 2011-12-15 16:45:12下载
- 积分:1
-
matrix_plot
根据已知的邻接矩阵画出对应的网络图,节点用蓝点表示,连接用线表示(According to the adjacency matrix of the known draw the corresponding network diagram, the node with the blue dot, and connected with lines)
- 2021-02-06 09:39:56下载
- 积分:1
-
numerical-methods
数值方法的5个重要的算法:
1.[Dirich.m] 求解拉普拉斯方程的狄利克雷方法. 用于偏微分方程的数值解
2.[Hamming.m] 汉明方法是用来修正微分方程的多步预测。
3. [Milne.m] 米尔恩 - 辛普森差分方程求解方法,用于预测校正方法。
4. [Rkf45.m]龙格 - 库塔 - 沃尔伯格错误控制和步骤的方法求解微分方程的近似解
5.[Romber.m]著名的龙贝格积分源代码。计算结果存在并显示为下三角矩阵。(Numerical Methods in five of the more important algorithms:
1. [Dirich.m] to solve the Laplace equation Dirichlet method for the numerical solution of partial differential equations
2.[Hamming.m] Hamming method is the multistep forecast corrected differential equations.
3. [Milne.m] the Milne- Simpson method as a differential equation solver used forecast correction method.
4. [Rkf45.m] Runge- Kutta- Wahlberg error control and step method for solving differential equations approximate solution
5. [Romber.m] the famous Romberg integral source code numerical integration, the presence of computable results show a lower triangular matrix.)
- 2013-03-09 01:35:19下载
- 积分:1
-
Target_Tracking_kalman_Program
说明: 使用卡尔曼滤波进行目标追踪的matlab源代码(The use of Kalman filter for target tracking matlab source code)
- 2008-09-20 09:22:41下载
- 积分:1
-
broyden迭代法和逆broyden迭代法
拟牛顿迭代法是相对比较新的一种方法,克服了牛顿迭代需要求导数和求逆的缺点,用于求解非线性方程组(For solving nonlinear equations)
- 2017-11-22 22:45:10下载
- 积分:1
-
munkres
指派问题的匈牙利解法,从文件中读入待指派的数据。(Assignment problem of the Hungarian method, read from a file to be assigned to data.)
- 2009-12-15 21:42:40下载
- 积分:1
-
surferce_wave
本人上传的为线性拉东变换方法,它能够提取面波的频散曲线(I uploaded is of linear radon transform method, it can extract of surface wave dispersion curves)
- 2012-10-24 17:15:55下载
- 积分: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
-
hw03_solution
n of the parity check matrix
- 2012-10-08 09:38:42下载
- 积分:1