期刊文献+

基于树状数组的逆序数计算方法 被引量:1

Algorithm of Inverse Number Based on Arborescence Array
下载PDF
导出
摘要 n个元素组成的置换a[1],a[2],…,a[n]。若i<j且a[i]>a[j],则称(a[i],a[j])是一个逆序对。置换中逆序对的个数称为置换的逆序数。按定义,计算逆序数要通过n(n-1)/2此次比较,时间复杂度是O(n2)。设计了一种新的方法,利用树状数组计算逆序数,时间复杂度降为O(nlog2(n))。主要思路是将元素从大到小依次放置在数状数组中,对于每一个元素i来说,因它前面的数比它大而计算出逆序数t[i],利用树状数组的结构特征,即可以O(log2(n))的时间复杂度而统计出t[i],那么最终总的逆序数为∑t[i]。 Suppose there is a permutation of a[1],a[2],…,a[n] that is constituted by n elements.If ij and a [i]a [j],then(a[i],a[j]) is called an inverted sequence pair.The number of inverted sequence in a permutation is called inverse number of a permutation.According to the definition,the caculation of inverse number must be compared with n(n-1)/2,and the time complexity is O(n2).A new method is devised to calculate the reverse numble by arborescence array and reduce the time complexity to O(nlog2(n)).The principal idea of this method is to place elements into arborescence array in descending order.With regard to each element,since the previ-ous number which is bigger and being worked out at reverse number t[i],when taking advantage of the architec-tural feature of arborescence array,it will come to t[i] by the time complexity of O(log2(n)) and finally reach the total reverse number as ∑t[i].
出处 《华东交通大学学报》 2011年第2期45-49,共5页 Journal of East China Jiaotong University
基金 国家自然科学基金项目(11061014) 江西省自然科学基金项目(2010GZS0031) 华东交通大学科学研究项目(09RJ07)
关键词 树状数组 逆序数 置换 算法 线段树 arborescence array inverse number permutation algorithm segment tree
  • 相关文献

参考文献7

二级参考文献13

  • 1周尚超.整数运算中的问题和解决方法[J].华东交通大学学报,2005,22(2):155-157. 被引量:3
  • 2J.Alvarez,M.Amadis,L.Rosales.Unimodality and Log -Concavity of Polynomials,in preparation,2000.
  • 3F.Brenti,Unimodal.log-concave and Polya frequency sequence in combinatorics[J].Mem.Amer.Math.Soc.,1989,81(413).
  • 4F.Brenti.Log-concave and unimodal sequences in algebra,combinatorics,and geometry:an update[J].Comtemp.Math.,1994,178:71 -89.
  • 5R.P.Stanley.Log-concave and unimodal sequences in algebra,combinatorics,and geometry[J].Ann.New York Acad.Sci.,1989,576:500-535.
  • 6王尊芳,石生明.高等代数(第三版)[M].北京:教育出版社,2003.
  • 7Guttman A. R-trees: A Dynamic Index Structure for Spatial Searching[J]. Proc. of SIGMOD, 1984, 4(2): 47-57.
  • 8Beckmann N, Kriegel H P, Schneider R, et al. The R^*-tree: An Efficient and Robust Access Method for Points and Rectangles[J]. Conf. on Management of Data, 1990,19(2): 322-331.
  • 9Theodoridis Y, Stefanakis E, Sellis T. Efficient Cost Models for Spatial Queries Using R-trees[J]. IEEE Transactions on Knowledge and Data Engineering, 2000,12(1): 19-32.
  • 10Bohm C, Berchtold S, Keim D. Searching in High-dimensional Spaces-index Structures for Improving the Performance of Multimedia Databases[J]. ACM Computing Surveys, 2001, 33(3): 322-373.

共引文献5

同被引文献9

  • 1Wolf W. Modern VLSI design: system - on - chip design[ M]. 3rd ed. New Jersey: Pearson Education, 2003 : 510 -522.
  • 2Song Xiao -yu, Wang Yu -ke. On the crossing distribution problem[ J]. ACM Transaction on Design Automation of Electronic Systems, 1999, 4(1) : 39 -51.
  • 3Sahni S. Data structures, algorithms, and applications in C [M]. 2nd ed. New Jersey: Silicon Press, 2004:546 -553.
  • 4Wang Xiao -dong. Algorithm design and analysis[ M]. 3rd ed. Beijing: Publishing House of Electronics Industry, 2007:74 -76.
  • 5Skiena S S. The algorithm design manul[ M ]. 2nd ed. Berlin: Springer, 2008:273 -315.
  • 6Han Zhu, Liu K J R. Resource allocation for wireless networks: basics, techniques, and applications[ M ]. Cambridge: Cam- bridge University Press, 2008 : 167 - 170.
  • 7Pandey H M. Designanalysis and algorithm[ M]. New Delhi : Firewall Media - Laxmi Publications, 2008 : 258 -286.
  • 8周培德.计算几何:算法设计与分析[M].4版.北京:清华大学出版社,2011.
  • 9Pressman R S. Software engineering: a practitioner's approach[ M ]. 7th ed. New York: McGraw- Hill, 2009:243 -538.

引证文献1

相关作者

内容加载中请稍等...

相关机构

内容加载中请稍等...

相关主题

内容加载中请稍等...

浏览历史

内容加载中请稍等...
;
使用帮助 返回顶部