41 research outputs found

    Practical variations of shellsort

    Get PDF
    Disponible dans les fichiers attachés à ce documen

    Spin-the-bottle Sort and Annealing Sort: Oblivious Sorting via Round-robin Random Comparisons

    Full text link
    We study sorting algorithms based on randomized round-robin comparisons. Specifically, we study Spin-the-bottle sort, where comparisons are unrestricted, and Annealing sort, where comparisons are restricted to a distance bounded by a \emph{temperature} parameter. Both algorithms are simple, randomized, data-oblivious sorting algorithms, which are useful in privacy-preserving computations, but, as we show, Annealing sort is much more efficient. We show that there is an input permutation that causes Spin-the-bottle sort to require Ω(n2logn)\Omega(n^2\log n) expected time in order to succeed, and that in O(n2logn)O(n^2\log n) time this algorithm succeeds with high probability for any input. We also show there is an implementation of Annealing sort that runs in O(nlogn)O(n\log n) time and succeeds with very high probability.Comment: Full version of a paper appearing in ANALCO 2011, in conjunction with SODA 201

    Ada style guide (version 1.1)

    Get PDF
    Ada is a programming language of considerable expressive power. The Ada Language Reference Manual provides a thorough definition of the language. However, it does not offer sufficient guidance on the appropriate use of Ada's powerful features. For this reason, the Goddard Space Flight Center Ada User's Group has produced this style guide which addresses such program style issues. The guide covers three areas of Ada program style: the structural decomposition of a program; the coding and the use of specific Ada features; and the textural formatting of a program

    Stepping Stones to Inductive Synthesis of Low-Level Looping Programs

    Full text link
    Inductive program synthesis, from input/output examples, can provide an opportunity to automatically create programs from scratch without presupposing the algorithmic form of the solution. For induction of general programs with loops (as opposed to loop-free programs, or synthesis for domain-specific languages), the state of the art is at the level of introductory programming assignments. Most problems that require algorithmic subtlety, such as fast sorting, have remained out of reach without the benefit of significant problem-specific background knowledge. A key challenge is to identify cues that are available to guide search towards correct looping programs. We present MAKESPEARE, a simple delayed-acceptance hillclimbing method that synthesizes low-level looping programs from input/output examples. During search, delayed acceptance bypasses small gains to identify significantly-improved stepping stone programs that tend to generalize and enable further progress. The method performs well on a set of established benchmarks, and succeeds on the previously unsolved "Collatz Numbers" program synthesis problem. Additional benchmarks include the problem of rapidly sorting integer arrays, in which we observe the emergence of comb sort (a Shell sort variant that is empirically fast). MAKESPEARE has also synthesized a record-setting program on one of the puzzles from the TIS-100 assembly language programming game.Comment: AAAI 201

    Classifying and recognizing students' sorting algorithm implementations in a data structures and algorithms course

    Get PDF
    We discuss an instrument for recognizing and classifying algorithms (Aari) in terms of whiteboxtesting. We examined freshmen students' sorting algorithm implementations in a datastructures and algorithms course in two rounds: at the beginning of the course before thestudents received any instruction on sorting algorithms, and after taking lectures on sortingalgorithms. We evaluated the performance of Aari with the implementations of each roundseparately. The results show that the sorting algorithms (in Java), which Aari has been trainedto recognize (Insertion sort, Selection sort, Bubble sort, Quicksort and Mergesort), arerecognized with an average accuracy of about 90%. When considering all the submitted sortingalgorithm implementations (including the variations of the standard algorithms), Aari achievedan overall accuracy being 71% and 81% for the first and second round, respectively. The manual analysis of the implementations revealed that students have manymisconceptions related to sorting algorithms. For example, they include unnecessary swaps intheir Insertion or Selection sort implementations. Based on the data, we present acategorization of these types of variations. We also discuss how these categories can be used toimprove education of sorting methods, and to further develop Aari as a white-box testing tool,which gives feedback to the students on their inappropriate solutions and asks them to correctthe problem; something black-box testing is not capable of doing

    Treatment of overlapping gaseous absorption with the correlated-k method in hot Jupiter and brown dwarf atmosphere models

    Get PDF
    This is the author accepted manuscript. The final version is available from EDP Sciences via the DOI in this record.The correlated-k method is frequently used to speed up radiation calculations in both one-dimensional and three-dimensional atmosphere models. An inherent difficulty with this method is how to treat overlapping absorption, i.e. absorption by more than one gas in a given spectral region. We have evaluated the applicability of three different methods in hot Jupiter and brown dwarf atmosphere models, all of which have been previously applied within models in the literature: (i) Random overlap, both with and without resorting and rebinning, (ii) equivalent extinction and (iii) pre-mixing of opacities, where (i) and (ii) combine k-coefficients for different gases to obtain k-coefficients for a mixture of gases, while (iii) calculates k-coefficients for a given mixture from the corresponding mixed line-by-line opacities. We find that the random overlap method is the most accurate and flexible of these treatments, and is fast enough to be used in one-dimensional models with resorting and rebinning. In three-dimensional models such as GCMs it is too slow, however, and equivalent extinction can provide a speed-up of at least a factor of three with only a minor loss of accuracy while at the same time retaining the flexibility gained by combining k-coefficients computed for each gas individually. Pre-mixed opacities are significantly less flexible, and we also find that particular care must be taken when using this method in order to to adequately resolve steep variations in composition at important chemical equilibrium boundaries. We use the random overlap method with resorting and rebinning in our one-dimensional atmosphere model and equivalent extinction in our GCM, which allows us to e.g. consistently treat the feedback of non-equilibrium chemistry on the total opacity and therefore the calculated P–T profiles in our modelsWe thank the referee, Mark Marley, for comments that significantly improved the paper. This work is partly supported by the European Research Council under the European Community’s Seventh Framework Programme (FP7/2007-2013 Grant Agreement No. 247060-PEPS and grant No. 320478-TOFU). D.S.A. acknowledges support from the NASA Astrobiology Program through the Nexus for Exoplanet System Science. J.M. acknowledges the support of a Met Office Academic Partnership secondment. The calculations for this paper were performed on the DiRAC Complexity machine, jointly funded by STFC and the Large Facilities Capital Fund of BIS, and the University of Exeter Super-computer, a DiRAC Facility jointly funded by STFC, the Large Facilities Capital Fund of BIS and the University of Exeter
    corecore