126,196 research outputs found

    Online Sorting via Searching and Selection

    Full text link
    In this paper, we present a framework based on a simple data structure and parameterized algorithms for the problems of finding items in an unsorted list of linearly ordered items based on their rank (selection) or value (search). As a side-effect of answering these online selection and search queries, we progressively sort the list. Our algorithms are based on Hoare's Quickselect, and are parameterized based on the pivot selection method. For example, if we choose the pivot as the last item in a subinterval, our framework yields algorithms that will answer q<=n unique selection and/or search queries in a total of O(n log q) average time. After q=\Omega(n) queries the list is sorted. Each repeated selection query takes constant time, and each repeated search query takes O(log n) time. The two query types can be interleaved freely. By plugging different pivot selection methods into our framework, these results can, for example, become randomized expected time or deterministic worst-case time. Our methods are easy to implement, and we show they perform well in practice

    Searching and Sorting Algorithms

    Get PDF
    This dissertation analyses two combinatorial questions that involve algorithmic solutions. First we consider the Robber Locating Game, a pursuit-evasion game introduced by Seager in 2012. This game is a variant of the renowned Cops and Robbers game; in this variant the robber does not disclose his location to the cop, and her aim is merely to locate rather than capture him. Although he moves around the graph as normal on his turns, on her turns she picks any vertex freely and asks how far he is from her probed vertex. We call a graph locatable if there is a possible cop strategy that will always locate the robber in finitely many moves, and non-locatable otherwise.In this dissertation we consider how much subdivision of a graph is necessary to make it locatable, establishing exact bounds in the case of complete and complete bipartite graphs, and a general (n/2 + 1) bound for all finite graphs. We also consider subdividing infinite graphs, exhibiting a sufficient subdivision function for the cases where subdividing them can make them locatable. Finally we close with a series of results about the game, including the relationship between locatability number and maximum degree and showing that every locatable graph is 4-colourable.In the second part we consider how a user can determine the ordering of a well-ordered set of elements, when he initially does not know the ordering but is given a scale. This scale takes k elements and returns the t_1, t_2, ..., t_s of them according to this ordering. We show that he cannot determine the complete ordering, since he cannot order the initial and final segments. Apart from this restriction we outline algorithms to enable the user to determine the ordering in both the online and offline cases. We show that in the online case he can determine the ordering in O(n log n) queries, and in the offline case in O(n^{k-t+1}) queries, which we show is the best possible order of the number of queries

    Quantum complexities of ordered searching, sorting, and element distinctness

    Full text link
    We consider the quantum complexities of the following three problems: searching an ordered list, sorting an un-ordered list, and deciding whether the numbers in a list are all distinct. Letting N be the number of elements in the input list, we prove a lower bound of \frac{1}{\pi}(\ln(N)-1) accesses to the list elements for ordered searching, a lower bound of \Omega(N\log{N}) binary comparisons for sorting, and a lower bound of \Omega(\sqrt{N}\log{N}) binary comparisons for element distinctness. The previously best known lower bounds are {1/12}\log_2(N) - O(1) due to Ambainis, \Omega(N), and \Omega(\sqrt{N}), respectively. Our proofs are based on a weighted all-pairs inner product argument. In addition to our lower bound results, we give a quantum algorithm for ordered searching using roughly 0.631 \log_2(N) oracle accesses. Our algorithm uses a quantum routine for traversing through a binary search tree faster than classically, and it is of a nature very different from a faster algorithm due to Farhi, Goldstone, Gutmann, and Sipser.Comment: This new version contains new results. To appear at ICALP '01. Some of the results have previously been presented at QIP '01. This paper subsumes the papers quant-ph/0009091 and quant-ph/000903

    Comparison and Enhancement of Sorting Algorithms

    Get PDF
    Some of the primordial issues in computer science is searching, arranging and ordering a list of items or information. Sorting is an important data structure operation, which makes these daunting tasks very easy and helps in searching and arranging the information. A lot of sorting algorithms has been developed to enhance and aggrandize the performance in terms of computational complexity, efficiency, memory, space, speed and other factors. Although there are an enormous number of sorting algorithms, searching and sorting problem has attracted a great deal of research and experimentation; because efficient sorting is important to optimize the use of other algorithms. This paper is an attempt to compare the performance of seven already existing sorting algorithm named as Bubble sort, Merge sort, Quick sort, Heap sort, Insertion sort, Shell sort, Selection sort and to provide an enhancement to these sorting algorithms to make the sorting through these algorithms better. In many cases this enhancement was found faster than the existing algorithms available

    Idempotent permutations

    Full text link
    Together with a characteristic function, idempotent permutations uniquely determine idempotent maps, as well as their linearly ordered arrangement simultaneously. Furthermore, in-place linear time transformations are possible between them. Hence, they may be important for succinct data structures, information storing, sorting and searching. In this study, their combinatorial interpretation is given and their application on sorting is examined. Given an array of n integer keys each in [1,n], if it is allowed to modify the keys in the range [-n,n], idempotent permutations make it possible to obtain linearly ordered arrangement of the keys in O(n) time using only 4log(n) bits, setting the theoretical lower bound of time and space complexity of sorting. If it is not allowed to modify the keys out of the range [1,n], then n+4log(n) bits are required where n of them is used to tag some of the keys.Comment: 32 page
    • …
    corecore