We introduce a novel approach to the classical problem of in-situ, stable merging, where \in-situ" means the use of no more than O(log 2 n) bits of extra memory for lists of size n. Shu emerge reduces the merging problem to the problem of realising the \perfect shu e" permutation, that is, the exact interleaving of two, equal length lists. The algorithm is recursive, using a logarithmic number of variables, and so does not use absolutely minimum storage, i.e., a xed number of variables. A simple method of realising the perfect shu e uses one extra bit per element, and so is not in-situ. We show that the perfect shu e can be attained using absolutely minimum storage and in linear time, at the expense of doubling the number of moves, relative to the simple method. We note that there is a worst case for Shu emerge requiring time (n log n), where n is the sum of the lengths of the input lists. We also present an analysis of a variant of Shu emerge which uses a generalised shu e and which has a provable average case time complexity of O(n log log m), where m is the length of the shortest input list. It is unlikely that the generalised shu e can be achieved in-situ. Linear time, in-situ, stable merging has previously been demonstrated. We present experimental evidence indicating that Shu emerge, although almost certainly not asymptotically linear, might be of value in practice. The relative simplicity of the basic method, particularly with respect to stability, also recommends it. This work was supported by the Natural Sciences and Engineering Research Council of Canada We describe a novel merging algorithm with certain properties of theoretical interest and possibly of practical value. The merging problem is to produce one sorted list from an input of two sorted lists. The properties of interest are execution time, memory usage and \stability". An \in-situ" merge, sort or other permutation, rearranges the subject elements within the space that they occupy, in contrast to the standard merge algorithm which duplicates the input space. We use the precise but tight de nition of \in-situ" Knu73] (Chapter 5, Section 5, Exercise 3) which allows the use of no more than O(log 2 n) bits over and above that space occupied by the elements themselves, where n is the number of elements. This de nition permits recursion, so long as the stack depth is restricted to O(log n), but does not allow the use of extra space proportional to n. It also implies that the lists be represented by arrays, or parts of arrays. The extra space used by the pointers in a linked list representation would be at least (pointer size n), and each pointer would require at least log n bits. Originally, what we are here referring to as \in-situ", was called \minimum storage", e.g., in the citation just given Knu73]. An even tighter restriction, sometimes referred to as \absolutely minimum storage", permits only O(log n) bits, i.e., a constant number of variables. Stability is the property of a merge or sort which guarantees that the order of equal elements in t...
We propose an algorithm that computes the length of a longest path in a cactus graph. Our algorithm can easily be modified to output a longest path as well or to solve the problem on cacti with edge or vertex weights. The algorithm works on rooted cacti and assigns to each vertex a two-number label, the first number being the desired parameter of the subcactus rooted at that vertex. The algorithm applies the divide-and-conquer approach and computes the label of each vertex from the labels of its children. The time complexity of our algorithm is linear in the number of vertices, thus improving the previously best quadratic time algorithm.
We investigate the NP-complete problem Vertex Separation (VS) on Maximal Outerplanar Graphs (mops). We formulate and prove a “main theorem for mops”, a necessary and sufficient condition for the vertex separation of a mop being k. The main theorem reduces the vertex separation of mops to a special kind of stretchability, one that we call affixability, of submops.
We investigate a recently introduced width measure of planarshapes called sweepwidth and prove a lower bound theorem on the sweepwidth.
scite is a Brooklyn-based organization that helps researchers better discover and understand research articles through Smart Citations–citations that display the context of the citation and describe whether the article provides supporting or contrasting evidence. scite is used by students and researchers from around the world and is funded in part by the National Science Foundation and the National Institute on Drug Abuse of the National Institutes of Health.
customersupport@researchsolutions.com
10624 S. Eastern Ave., Ste. A-614
Henderson, NV 89052, USA
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.
Copyright © 2024 scite LLC. All rights reserved.
Made with 💙 for researchers
Part of the Research Solutions Family.