文件名称:Statistics
-
所属分类:
- 标签属性:
- 上传时间:2013-11-10
-
文件大小:13.46kb
-
已下载:0次
-
提 供 者:
-
相关连接:无下载说明:别用迅雷下载,失败请重下,重下不扣分!
介绍说明--下载内容来自于网络,使用问题请自行百度
统计逆序对,设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?
比如 <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?
(系统自动生成,下载前可以参看下载内容)
下载文件列表
统计逆序对/tongjinixudui/bin/Debug/tongjinixudui.exe
统计逆序对/tongjinixudui/main.c
统计逆序对/tongjinixudui/obj/Debug/main.o
统计逆序对/tongjinixudui/tongjinixudui.cbp
统计逆序对/tongjinixudui/tongjinixudui.depend
统计逆序对/tongjinixudui/tongjinixudui.layout
统计逆序对/tongjinixudui/bin/Debug
统计逆序对/tongjinixudui/obj/Debug
统计逆序对/tongjinixudui/bin
统计逆序对/tongjinixudui/obj
统计逆序对/tongjinixudui
统计逆序对
统计逆序对/tongjinixudui/main.c
统计逆序对/tongjinixudui/obj/Debug/main.o
统计逆序对/tongjinixudui/tongjinixudui.cbp
统计逆序对/tongjinixudui/tongjinixudui.depend
统计逆序对/tongjinixudui/tongjinixudui.layout
统计逆序对/tongjinixudui/bin/Debug
统计逆序对/tongjinixudui/obj/Debug
统计逆序对/tongjinixudui/bin
统计逆序对/tongjinixudui/obj
统计逆序对/tongjinixudui
统计逆序对
本网站为编程资源及源代码搜集、介绍的搜索网站,版权归原作者所有! 粤ICP备11031372号
1999-2046 搜珍网 All Rights Reserved.