356 research outputs found

    QuickHeapsort: Modifications and improved analysis

    Full text link
    We present a new analysis for QuickHeapsort splitting it into the analysis of the partition-phases and the analysis of the heap-phases. This enables us to consider samples of non-constant size for the pivot selection and leads to better theoretical bounds for the algorithm. Furthermore we introduce some modifications of QuickHeapsort, both in-place and using n extra bits. We show that on every input the expected number of comparisons is n lg n - 0.03n + o(n) (in-place) respectively n lg n -0.997 n+ o (n). Both estimates improve the previously known best results. (It is conjectured in Wegener93 that the in-place algorithm Bottom-Up-Heapsort uses at most n lg n + 0.4 n on average and for Weak-Heapsort which uses n extra-bits the average number of comparisons is at most n lg n -0.42n in EdelkampS02.) Moreover, our non-in-place variant can even compete with index based Heapsort variants (e.g. Rank-Heapsort in WangW07) and Relaxed-Weak-Heapsort (n lg n -0.9 n+ o (n) comparisons in the worst case) for which no O(n)-bound on the number of extra bits is known

    An efficient sorting algorithm - Ultimate Heapsort(UHS)

    Full text link
    Motivated by the development of computer theory, the sorting algorithm is emerging in an endless stream. Inspired by decrease and conquer method, we propose a brand new sorting algorithmUltimately Heapsort. The algorithm consists of two parts: building a heap and adjusting a heap. Through the asymptotic analysis and experimental analysis of the algorithm, the time complexity of our algorithm can reach O(nlogn) under any condition. Moreover, its space complexity is only O(1). It can be seen that our algorithm is superior to all previous algorithms

    QuickXsort - A Fast Sorting Scheme in Theory and Practice

    Full text link
    QuickXsort is a highly efficient in-place sequential sorting scheme that mixes Hoare's Quicksort algorithm with X, where X can be chosen from a wider range of other known sorting algorithms, like Heapsort, Insertionsort and Mergesort. Its major advantage is that QuickXsort can be in-place even if X is not. In this work we provide general transfer theorems expressing the number of comparisons of QuickXsort in terms of the number of comparisons of X. More specifically, if pivots are chosen as medians of (not too fast) growing size samples, the average number of comparisons of QuickXsort and X differ only by o(n)o(n)-terms. For median-of-kk pivot selection for some constant kk, the difference is a linear term whose coefficient we compute precisely. For instance, median-of-three QuickMergesort uses at most nlgn0.8358n+O(logn)n \lg n - 0.8358n + O(\log n) comparisons. Furthermore, we examine the possibility of sorting base cases with some other algorithm using even less comparisons. By doing so the average-case number of comparisons can be reduced down to nlgn1.4106n+o(n)n \lg n- 1.4106n + o(n) for a remaining gap of only 0.0321n0.0321n comparisons to the known lower bound (while using only O(logn)O(\log n) additional space and O(nlogn)O(n \log n) time overall). Implementations of these sorting strategies show that the algorithms challenge well-established library implementations like Musser's Introsort

    Optimum Partition Parameter of Divide-and-Conquer Algorithm for Solving Closest-Pair Problem

    Full text link
    Divide and Conquer is a well known algorithmic procedure for solving many kinds of problem. In this procedure, the problem is partitioned into two parts until the problem is trivially solvable. Finding the distance of the closest pair is an interesting topic in computer science. With divide and conquer algorithm we can solve closest pair problem. Here also the problem is partitioned into two parts until the problem is trivially solvable. But it is theoretically and practically observed that sometimes partitioning the problem space into more than two parts can give better performances. In this paper, a new proposal is given that dividing the problem space into (n) number of parts can give better result while divide and conquer algorithm is used for solving the closest pair of point's problem.Comment: arXiv admin note: substantial text overlap with arXiv:1010.590

    A Complete Worst-Case Analysis of Heapsort with Experimental Verification of Its Results, A manuscript (MS)

    Full text link
    A rigorous proof is presented that the number of comparisons of keys performed in the worst case by Heapsort{\tt Heapsort} on any array of size N2N \geq 2 is equal to: 2(N1)(lgN12+ε)2s2(N)e2(N)+min(lg(N1),2)+6+c, 2 (N-1)\, ( \, \lg \frac{N-1}{2} +\varepsilon \, ) - 2s_2(N) - e_2(N) + \min (\lfloor \lg (N-1) \rfloor, 2) + 6 + c, where ε \varepsilon , given by: ε=1+lg(N1)lg(N1)2lg(N1)lg(N1),\varepsilon = 1 + \lceil \lg \, (N-1) \rceil - \lg \, (N-1) - 2^{\lceil \lg \, (N-1) \rceil - \lg \, (N-1)} , is a function of N N with the minimum value 0 and and the supremum value δ=1lge+lglge0.0860713320559342\delta = 1 - \lg e + \lg \lg e \approx 0.0860713320559342, s2(N)s_2(N) is the sum of all digits of the binary representation of NN, e2(N)e_2(N) is the exponent of 22 in the prime factorization of NN, and c c is a binary function on the set of integers defined by: c=1c = 1, if N2lgN4N \leq 2 ^{\lceil \lg N \rceil} - 4, and c=0c = 0, otherwise. An algorithm that generates worst-case input arrays of any size N2 N \geq 2 for Heapsort{\tt Heapsort} is offered. The algorithm has been implemented in Java, runs in O(NlogN)O( N \log N ) time, and allows for precise experimental verification of the above formula.Comment: 115 pages 41 figure

    Dualheap Sort Algorithm: An Inherently Parallel Generalization of Heapsort

    Full text link
    A generalization of the heapsort algorithm is proposed. At the expense of about 50% more comparison and move operations for typical cases, the dualheap sort algorithm offers several advantages over heapsort: improved cache performance, better performance if the input happens to be already sorted, and easier parallel implementations.Comment: 4 pages, 4 figure

    A new hardware prefetching scheme based on dynamic interpretation of the instruction stream

    Get PDF
    It is well known that memory latency is a major deterrent to achieving the maximum possible performance of a today\u27s high speed RISC processors. Techniques to reduce or tolerate large memory latencies become essential for achieving high processor utilization;Many methods, ranging from software to hardware solutions, have been studied with varying amounts of success. Most techniques have concentrated on data prefetching. However, our simulations show that the CPU is stalled up to 50% of the time waiting for instructions. The instruction memory latency reduction technique typically used in CPU designs today is the one block look-ahead (OBL) method;In this thesis, I present a new hardware prefetching scheme based on dynamic interpretation of the instruction stream. This is done by adding a small pipeline to the cache that scans forward in the instruction stream interpreting each instruction and predicting the future execution path. It then prefetches what it predicts the CPU will be executing in the near future;The pipelined prefetching engine has been shown to be a very effective technique for decreasing the instruction stall cycles in typical on-chip cache memories used today. It performs well, yielding reductions in stall cycles up to 30% or more for both scientific and general purpose programs, and has been shown to reduce the number of instruction stall cycles as compared to the OBL technique as well;The idea of sub-line prefetching was also studied and presented. It was thought that prefetching full cache lines might present too much overhead in terms of bus bandwidth, so prefetches should only fill partial cache lines instead. However it was determined that prefetching partial cache lines does not show any benefit when dealing with cache lines smaller than 128 bytes

    Multiresolution Priority Queues

    Full text link
    Priority queues are container data structures essential to many high performance computing (HPC) applications. In this paper, we introduce multiresolution priority queues, a data structure that improves the performance of the standard heap based implementations by trading off a controllable amount of resolution in the space of priorities. The new data structure can reduce the worst case performance of inserting an element from O(log(n)) to O(log(r)), where n is the number of elements in the queue and r is the number of resolution groups in the priority space. The worst case cost of removing the top element is O(1). When the number of elements in the table is high, the amortized cost to insert an element becomes O(1)

    Performance Evaluation of Sorting Algorithms in Raspberry Pi and Personal Computer

    Get PDF
    Nowadays, more and more data is going to be collected. Most of the collected data must be sorted to be analysed. Thus it is important to use efficient algorithms to save time and energy. This is especially important for battery-operated devices that collect and sort data directly. The lifetime of the battery can be remarkably extended by choosing effective sorting algorithms. Furthermore, processors with lower clock frequencies can be used, leading to lower battery consumption. This thesis focuses on the time complexity of algorithms (bubble sort, insertion sort, quick sort and heap sort) executed on raspberry Pi and personal computer. In this thesis, a client and a server have been implemented. The client is a Graphical User Interface (GUI) that generates random numbers, which are sent to the server. On the server the random numbers are sorted and the sorting time is measured. After sorting, the random numbers will be sent back to the client where they are displayed on the GUI. The sorting time is also send to the GUI in order to display it. It is to mention that the time consumption is measured with timing functions of the C library. An oscilloscope has been used to check if the timing function works properly. At the end, the performances of four sorting algorithms on Raspberry Pi and on the Personal Computer (PC) are compared.fi=Opinnäytetyö kokotekstinä PDF-muodossa.|en=Thesis fulltext in PDF format.|sv=Lärdomsprov tillgängligt som fulltext i PDF-format

    Elementary Yet Precise Worst-case Analysis of MergeSort, A short version (SV)

    Full text link
    This paper offers two elementary yet precise derivations of an exact formula W(n)=i=1nlgi=nlgn2lgn+1 W(n) = \sum_{i=1} ^{n} \lceil \lg i \rceil = n \lceil \lg n \rceil - 2^{\lceil \lg n \rceil} + 1 for the maximum number W(n) W(n) of comparisons of keys performed by MergeSort {\tt MergeSort} on an n n -element array. The first of the two, due to its structural regularity, is well worth carefully studying in its own right. Close smooth bounds on W(n) W(n) are derived. It seems interesting that W(n) W(n) is linear between the points n=2lgn n = 2^{\lfloor \lg n \rfloor} and it linearly interpolates its own lower bound nlgnn+1 n \lg n - n + 1 between these points.Comment: 25 pages, 12 figures, three of which contain working Java method
    corecore