对数表及其在转置、反转和块交换排序中的应用
Log-Lists and Their Applications to Sorting by Transpositions, Reversals and Block-Interchanges
摘要:
D. D. Sleator和R.E. Tarjan(Journal of Computer and System Sciences,1983)提出了一种新的动态根树模型,其目标是在切割和链接操作下有效地维护顶点不相交的动态根树的森林。这些操作分别是将子树从树中断开,以及通过边连接两棵树。此外,链接切割树允许更改树的根,并对树的弧上定义的成本值执行许多更新和查询。所有这些操作都是在$O(\log\, n)$分摊时间或最坏情况下执行的,具体取决于实现,其中$n$是林的总大小。在本文中,我们表明,使用链接切割树(我们称之为$\log$列表)实现的元素列表,使我们能够获得一个共同的运行时间的$O(\log\, n)$的经典操作列表,但也为一些其他的基本操作,通常需要线性时间的列表。这种操作需要在由其端点定义的子列表中找到最小/最大元素,列表中给定元素的位置或放置在列表中给定位置的元素;或者它们需要添加值$a$,或者乘以$-1$,子列表中的所有元素。此外,我们使用$\log$ -列表来实现几个现有的算法排序排列的换位和/或反转和/或块互换,并获得$O(n\,\log\, n)$运行时间为所有这些。通过这种方式,几种算法的运行时间得到了改善,而在其他情况下,我们的算法执行以及现有的最佳实现。
英文摘要:
Link-cut trees have been introduced by D.D. Sleator and R.E. Tarjan (Journal of Computer and System Sciences, 1983) with the aim of efficiently maintaining a forest of vertex-disjoint dynamic rooted trees under cut and link operations. These operations respectively disconnect a subtree from a tree, and join two trees by an edge. Additionally, link-cut trees allow to change the root of a tree and to perform a number of updates and queries on cost values defined on the arcs of the trees. All these operations are performed in $O(\log\, n)$ amortized or worst-case time, depending on the implementation, where $n$ is the total size of the forest. In this paper, we show that a list of elements implemented using link-cut trees (we call it a $\log$-list) allows us to obtain a common running time of $O(\log\, n)$ for the classical operations on lists, but also for some other essential operations that usually take linear time on lists. Such operations require to find the minimum/maximum element in a sublist defined by its endpoints, the position of a given element in the list or the element placed at a given position in the list; or they require to add a value $a$, or to multiply by $-1$, all the elements in a sublist. Furthermore, we use $\log$-lists to implement several existing algorithms for sorting permutations by transpositions and/or reversals and/or block-interchanges, and obtain $O(n\,\log\, n)$ running time for all of them. In this way, the running time of several algorithms is improved, whereas in other cases our algorithms perform as well as the best existing implementations.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。