Description: 主函数,实现枚举排序,属于并行程序。输入:argc为命令行参数个数;输出:返回1代表程序正常结束-The main function, realize enumeration sort, belonging to parallel programming. Input: argc for the number of command-line parameters Output: the return of one representative of the normal end of procedure Platform: |
Size: 2048 |
Author:王通 |
Hits:
Description: 用mpi实现的枚举排序,测试请在mpi的并行环境中进行-Enumeration sorting using mpi implementation, testing in the mpi parallel environment for the conduct Platform: |
Size: 2048 |
Author:liuqiang |
Hits:
Description: <经典算法合集>其中包括:
最小生成树
MD5加密
LZW压缩
josephus
乘法表
积分
枚举
基数转换
矩阵问题举例
求解质数
圆周率的求法
改进的快速排序法
几种插入排序法
水仙花数
迷宫生成器
生命游戏
递归
回溯
贪心
动态规划
排序算法-" Classical algorithm Collection> These include: minimum spanning tree MD5 encryption LZW compression josephus multiplication table base transformation matrix integral enumeration problem solving prime number example, the rate of Improved Methods of the circumference of the Quick Sort Insertion Sort Narcissistic number of several maze generator recursive Game of Life dynamic programming backtracking greedy sorting algorithm Platform: |
Size: 4215808 |
Author:我很笨 |
Hits:
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个元素的逆序对数目。
注意此题请勿用O(n^2)的简单枚举去实现。
并思考如下问题:
(1)怎样的数组含有最多的逆序对?最多的又是多少个呢?
(2)插入排序的运行时间和数组中逆序对的个数有关系吗?什么关系?-Statistical reverse pair, set a [0 ... n-1] is an array that contains the number n, if the i <j的情况下,有a[i]> a [j], called (i, j) is a array of a reverse pair (inversion). Such as < 2,3,8,6,1> has 5 reverse pairs. Consider a worst-case O (nlogn) algorithm to determine the n number of elements on the reverse. Note that this problem Do not use O (n ^ 2) to achieve a simple enumeration. And consider the following questions: (1) how the array contains the most reverse of its? Most is how many do? (2) the running time of insertion sort an array in reverse order and the number on the relationship you have? What is the relationship? Platform: |
Size: 13312 |
Author:姚先生 |
Hits: