Bulk Updates and Cache Sensitivity in Search Trees

Total Page:16

File Type:pdf, Size:1020Kb

Bulk Updates and Cache Sensitivity in Search Trees BULK UPDATES AND CACHE SENSITIVITY INSEARCHTREES TKK Research Reports in Computer Science and Engineering A Espoo 2009 TKK-CSE-A2/09 BULK UPDATES AND CACHE SENSITIVITY INSEARCHTREES Doctoral Dissertation Riku Saikkonen Dissertation for the degree of Doctor of Science in Technology to be presented with due permission of the Faculty of Information and Natural Sciences, Helsinki University of Technology for public examination and debate in Auditorium T2 at Helsinki University of Technology (Espoo, Finland) on the 4th of September, 2009, at 12 noon. Helsinki University of Technology Faculty of Information and Natural Sciences Department of Computer Science and Engineering Teknillinen korkeakoulu Informaatio- ja luonnontieteiden tiedekunta Tietotekniikan laitos Distribution: Helsinki University of Technology Faculty of Information and Natural Sciences Department of Computer Science and Engineering P.O. Box 5400 FI-02015 TKK FINLAND URL: http://www.cse.tkk.fi/ Tel. +358 9 451 3228 Fax. +358 9 451 3293 E-mail: [email protected].fi °c 2009 Riku Saikkonen Layout: Riku Saikkonen (except cover) Cover image: Riku Saikkonen Set in the Computer Modern typeface family designed by Donald E. Knuth. ISBN 978-952-248-037-8 ISBN 978-952-248-038-5 (PDF) ISSN 1797-6928 ISSN 1797-6936 (PDF) URL: http://lib.tkk.fi/Diss/2009/isbn9789522480385/ Multiprint Oy Espoo 2009 AB ABSTRACT OF DOCTORAL DISSERTATION HELSINKI UNIVERSITY OF TECHNOLOGY P.O. Box 1000, FI-02015 TKK http://www.tkk.fi/ Author Riku Saikkonen Name of the dissertation Bulk Updates and Cache Sensitivity in Search Trees Manuscript submitted 09.04.2009 Manuscript revised 15.08.2009 Date of the defence 04.09.2009 £ Monograph ¤ Article dissertation (summary + original articles) Faculty Faculty of Information and Natural Sciences Department Department of Computer Science and Engineering Field of research Software Systems Opponent(s) Prof. Peter Widmayer Supervisor Prof. Eljas Soisalon-Soininen Instructor Prof. Eljas Soisalon-Soininen Abstract This thesis examines two topics related to binary search trees: cache-sensitive memory layouts and avl-tree bulk-update operations. Bulk updates are also applied to adaptive sorting. Cache-sensitive data structures are tailored to the hardware caches in modern computers. The thesis presents a method for adding cache-sensitivity to binary search trees without changing the rebalancing strategy. Cache- sensitivity is maintained using worst-case constant-time operations executed when the tree changes. The thesis presents experiments performed on avl trees and red-black trees, including a comparison with cache-sensitive B-trees. Next, the thesis examines bulk insertion and bulk deletion in avl trees. Bulk insertion inserts several keys in one operation. The number of rotations used by avl-tree bulk insertion is shown to be worst-case logarithmic in the number of inserted keys, if they go to the same location in the tree. Bulk deletion deletes an interval of keys. When amortized over a sequence of bulk deletions, each deletion requires a number of rotations that is logarithmic in the number of deleted keys. The search cost and total rebalancing complexity of inserting or deleting keys from several locations in the tree are also analyzed. Experiments show that the algorithms work efficiently with randomly generated input data. Adaptive sorting algorithms are efficient when the input is nearly sorted according to some measure of pre- sortedness. The thesis presents an avl-tree-based variation of the adaptive sorting algorithm known as local insertion sort. Bulk insertion is applied by extracting consecutive ascending or descending keys from the input to be sorted. A variant that does not require a special bulk-insertion algorithm is also given. Experiments show that applying bulk insertion considerably reduces the number of comparisons and time needed to sort nearly sorted sequences. The algorithms are also compared with various other adaptive and non-adaptive sorting algorithms. Keywords cache-sensitivity, cache-consciousness, bulk insertion, bulk deletion, adaptive sorting, avl tree, binary search tree ISBN (printed) 978-952-248-037-8 ISSN (printed) 1797-6928 ISBN (pdf) 978-952-248-038-5 ISSN (pdf) 1797-6936 Language English Number of pages 144 p. Publisher Department of Computer Science and Engineering Print distribution Department of Computer Science and Engineering £ The dissertation can be read at http://lib.tkk.fi/Diss/2009/isbn9789522480385/ AB VAIT¨ OSKIRJAN¨ TIIVISTELMA¨ TEKNILLINEN KORKEAKOULU PL 1000, 02015 TKK http://www.tkk.fi/ Tekij¨a Riku Saikkonen V¨ait¨oskirjan nimi Er¨ap¨aivitykset ja v¨alimuistitietoisuus hakupuissa K¨asikirjoituksen p¨aiv¨am¨a¨ar¨a 09.04.2009 Korjatun k¨asikirjoituksen p¨aiv¨am¨a¨ar¨a 15.08.2009 V¨ait¨ostilaisuuden ajankohta 04.09.2009 £ Monografia ¤ Yhdistelm¨av¨ait¨oskirja (yhteenveto + erillisartikkelit) Tiedekunta Informaatio- ja luonnontieteiden tiedekunta Laitos Tietotekniikan laitos Tutkimusala Ohjelmistoj¨arjestelm¨at Vastav¨aitt¨aj¨a(t) prof. Peter Widmayer Ty¨on valvoja prof. Eljas Soisalon-Soininen Ty¨on ohjaaja prof. Eljas Soisalon-Soininen Tiivistelm¨a V¨ait¨oskirja k¨asittelee kahta bin¨a¨arisiin hakupuihin liittyv¨a¨a aihetta: v¨alimuistitietoista solmujen sijoittamista muistiin sek¨a avl-puiden er¨ap¨aivitysoperaatioita. Er¨ap¨aivityksi¨a my¨os sovelletaan mukautuvaan j¨arjest¨amiseen. V¨alimuistitietoiset tietorakenteet on sovitettu nykyisten tietokoneiden laitteistotason v¨alimuisteihin. V¨ait¨oskirja esittelee tavan tehd¨a bin¨a¨arisist¨a hakupuista v¨alimuistitietoisia muuttamatta hakupuun tasapainotusmenetel- m¨a¨a. V¨alimuistitietoisuus s¨ailytet¨a¨an tekem¨all¨a puun muuttuessa pahimmassakin tapauksessa vakioaikaisia ope- raatioita. V¨ait¨oskirja esittelee avl- ja punamustilla puilla tehtyj¨a kokeita, sis¨alt¨aen vertailun v¨alimuistitietoisiin B-puihin. Seuraavaksi v¨ait¨oskirja k¨asittelee avl-puiden er¨alis¨ays- ja er¨apoisto-operaatioita. Er¨alis¨ays lis¨a¨a monta avainta puuhun kerralla. V¨ait¨oskirjassa n¨aytet¨a¨an, ett¨a avl-puun er¨alis¨ays tekee pahimmassa tapauksessa logaritmi- sen m¨a¨ar¨an kiertoja suhteessa lis¨attyjen avainten lukum¨a¨ar¨a¨an, jos avaimet kuuluvat puussa samaan kohtaan. Er¨apoisto poistaa puusta kokonaisen avainv¨alin. Jonossa er¨apoisto-operaatioita kukin poisto tarvitsee tasoite- tusti logaritmisen m¨a¨ar¨an kiertoja suhteessa poistettavien avainten lukum¨a¨ar¨a¨an. Lis¨aksi tutkitaan hakukus- tannusta ja koko tasapainotuksen kustannusta tilanteessa, jossa lis¨ayksi¨a tai poistoja tehd¨a¨an useaan kohtaan puussa. Koetulosten mukaan algoritmit toimivat tehokkaasti satunnaisesti tuotetuilla sy¨otteill¨a. Mukautuvat j¨arjest¨amisalgoritmit ovat tehokkaita, kun sy¨ote on ennest¨a¨an melkein j¨arjestyksess¨a jonkin j¨arjestyst¨a kuvaavan suureen mukaan. V¨ait¨oskirja esittelee avl-puupohjaisen muunnelman paikallinen lis¨aysj¨ar- jest¨aminen -nimisest¨a mukautuvasta j¨arjest¨amisalgoritmista. Er¨alis¨ayst¨a sovelletaan ker¨a¨am¨all¨a j¨arjestett¨av¨ast¨a sy¨otteest¨a per¨akk¨aisi¨a kasvavia tai v¨ahenevi¨a avaimia. Lis¨aksi esitell¨a¨an muunnelma, joka ei tarvitse varsinais- ta er¨alis¨aysalgoritmia. Koetulosten mukaan er¨alis¨ayksen soveltaminen v¨ahent¨a¨a tarvittavia vertailuoperaatioita ja suoritusaikaa huomattavasti, kun j¨arjestett¨av¨a jono on melkein j¨arjestyksess¨a. Algoritmeja verrataan my¨os muihin mukautuviin ja ei-mukautuviin j¨arjest¨amisalgoritmeihin. Asiasanat v¨alimuistitietoisuus, er¨alis¨ays, er¨apoisto, mukautuva j¨arjest¨aminen, avl-puu, bin¨a¨arinen hakupuu ISBN (painettu) 978-952-248-037-8 ISSN (painettu) 1797-6928 ISBN (pdf) 978-952-248-038-5 ISSN (pdf) 1797-6936 Kieli englanti Sivum¨a¨ar¨a 144 s. Julkaisija Tietotekniikan laitos Painetun v¨ait¨oskirjan jakelu Tietotekniikan laitos £ Luettavissa verkossa osoitteessa http://lib.tkk.fi/Diss/2009/isbn9789522480385/ ix Preface First of all, I would like to thank the supervisor of this work, Professor Eljas Soisalon-Soininen. He has introduced me to the field of algorithm and data structure research and provided an environment where I had the opportunity to concentrate primarily on the research work. He has been very supportive, and an extremely valuable guide and source of new ideas for the research. I am grateful to Professors Tapio Elomaa (Tampere University of Technology) and Otto Nurmi (University of Helsinki) for their detailed and valuable comments on the manuscript, and to Professor Peter Wid- mayer (eth Z¨urich) for kindly agreeing to be the opponent. The research presented in this thesis was carried out at the Depart- ment of Computer Science and Engineering at the Helsinki University of Technology. I thank the Department, as well as the Helsinki Gradu- ate School in Computer Science and Engineering and the Academy of Finland for providing the financial support that enabled me to work on this thesis. I would also like to thank the authors (far too many to list here) of the free open-source software that I used in this work. The most useful programs were gnu Emacs, Latex and its packages, Gnuplot, the gnu C compiler, and Perl. Thanks also to the people behind the Debian gnu/Linux distribution, which has provided a stable operating system that included all the above software. Finally, I wish to thank my family and friends for their support throughout my studies. Espoo, August 2009 Riku Saikkonen x xi Contents 1 INTRODUCTION 1 1.1 Bulk updates · p. 1 1.2 Cache sensitivity · p. 2 1.3 Adaptive sorting · p. 3 1.4 Organization · p. 4 2 BACKGROUND 5 2.1 Search trees · p. 5 2.2 avl trees · p. 6 2.3 Red-black trees · p. 7 2.4 Internal and external trees · p. 8 2.5 Height-valued trees · p. 10 2.6 Parent links · p. 11 2.7 Relaxed balancing · p. 11 2.8 Bulk updates · p. 12 2.9 Cache-conscious search trees · p. 13 2.10 Adaptive sorting · p. 15 2.11 Finger trees · p. 17 3 CACHE-SENSITIVE BINARY SEARCH TREES 19 3.1 Cache model · p. 19 3.2 Multi-level cache-sensitive layout · p. 21 3.3 Global relocation · p. 24 3.4 Local relocation · p.
Recommended publications
  • 1 Suffix Trees
    This material takes about 1.5 hours. 1 Suffix Trees Gusfield: Algorithms on Strings, Trees, and Sequences. Weiner 73 “Linear Pattern-matching algorithms” IEEE conference on automata and switching theory McCreight 76 “A space-economical suffix tree construction algorithm” JACM 23(2) 1976 Chen and Seifras 85 “Efficient and Elegegant Suffix tree construction” in Apos- tolico/Galil Combninatorial Algorithms on Words Another “search” structure, dedicated to strings. Basic problem: match a “pattern” (of length m) to “text” (of length n) • goal: decide if a given string (“pattern”) is a substring of the text • possibly created by concatenating short ones, eg newspaper • application in IR, also computational bio (DNA seqs) • if pattern avilable first, can build DFA, run in time linear in text • if text available first, can build suffix tree, run in time linear in pattern. • applications in computational bio. First idea: binary tree on strings. Inefficient because run over pattern many times. • fractional cascading? • realize only need one character at each node! Tries: • used to store dictionary of strings • trees with children indexed by “alphabet” • time to search equal length of query string • insertion ditto. • optimal, since even hashing requires this time to hash. • but better, because no “hash function” computed. • space an issue: – using array increases stroage cost by |Σ| – using binary tree on alphabet increases search time by log |Σ| 1 – ok for “const alphabet” – if really fussy, could use hash-table at each node. • size in worst case: sum of word lengths (so pretty much solves “dictionary” problem. But what about substrings? • Relevance to DNA searches • idea: trie of all n2 substrings • equivalent to trie of all n suffixes.
    [Show full text]
  • Managing Unbounded-Length Keys in Comparison-Driven Data
    Managing Unbounded-Length Keys in Comparison-Driven Data Structures with Applications to On-Line Indexing∗ Amihood Amir Gianni Franceschini Department of Computer Science Dipartimento di Informatica Bar-Ilan University, Israel Universita` di Pisa, Italy and Department of Computer Science John Hopkins University, Baltimore MD Roberto Grossi Tsvi Kopelowitz Dipartimento di Informatica Department of Computer Science Universita` di Pisa, Italy Bar-Ilan University, Israel Moshe Lewenstein Noa Lewenstein Department of Computer Science Department of Computer Science Bar-Ilan University, Israel Netanya College, Israel arXiv:1306.0406v1 [cs.DS] 3 Jun 2013 ∗Parts of this paper appeared as extended abstracts in [3, 20]. 1 Abstract This paper presents a general technique for optimally transforming any dynamic data struc- ture that operates on atomic and indivisible keys by constant-time comparisons, into a data structure that handles unbounded-length keys whose comparison cost is not a constant. Exam- ples of these keys are strings, multi-dimensional points, multiple-precision numbers, multi-key data (e.g. records), XML paths, URL addresses, etc. The technique is more general than what has been done in previous work as no particular exploitation of the underlying structure of is required. The only requirement is that the insertion of a key must identify its predecessor or its successor. Using the proposed technique, online suffix tree construction can be done in worst case time O(log n) per input symbol (as opposed to amortized O(log n) time per symbol, achieved by previously known algorithms). To our knowledge, our algorithm is the first that achieves O(log n) worst case time per input symbol.
    [Show full text]
  • Augmentation: Range Trees (PDF)
    Lecture 9 Augmentation 6.046J Spring 2015 Lecture 9: Augmentation This lecture covers augmentation of data structures, including • easy tree augmentation • order-statistics trees • finger search trees, and • range trees The main idea is to modify “off-the-shelf” common data structures to store (and update) additional information. Easy Tree Augmentation The goal here is to store x.f at each node x, which is a function of the node, namely f(subtree rooted at x). Suppose x.f can be computed (updated) in O(1) time from x, children and children.f. Then, modification a set S of nodes costs O(# of ancestors of S)toupdate x.f, because we need to walk up the tree to the root. Two examples of O(lg n) updates are • AVL trees: after rotating two nodes, first update the new bottom node and then update the new top node • 2-3 trees: after splitting a node, update the two new nodes. • In both cases, then update up the tree. Order-Statistics Trees (from 6.006) The goal of order-statistics trees is to design an Abstract Data Type (ADT) interface that supports the following operations • insert(x), delete(x), successor(x), • rank(x): find x’s index in the sorted order, i.e., # of elements <x, • select(i): find the element with rank i. 1 Lecture 9 Augmentation 6.046J Spring 2015 We can implement the above ADT using easy tree augmentation on AVL trees (or 2-3 trees) to store subtree size: f(subtree) = # of nodes in it. Then we also have x.size =1+ c.size for c in x.children.
    [Show full text]
  • Advanced Data Structures
    Advanced Data Structures PETER BRASS City College of New York CAMBRIDGE UNIVERSITY PRESS Cambridge, New York, Melbourne, Madrid, Cape Town, Singapore, São Paulo Cambridge University Press The Edinburgh Building, Cambridge CB2 8RU, UK Published in the United States of America by Cambridge University Press, New York www.cambridge.org Information on this title: www.cambridge.org/9780521880374 © Peter Brass 2008 This publication is in copyright. Subject to statutory exception and to the provision of relevant collective licensing agreements, no reproduction of any part may take place without the written permission of Cambridge University Press. First published in print format 2008 ISBN-13 978-0-511-43685-7 eBook (EBL) ISBN-13 978-0-521-88037-4 hardback Cambridge University Press has no responsibility for the persistence or accuracy of urls for external or third-party internet websites referred to in this publication, and does not guarantee that any content on such websites is, or will remain, accurate or appropriate. Contents Preface page xi 1 Elementary Structures 1 1.1 Stack 1 1.2 Queue 8 1.3 Double-Ended Queue 16 1.4 Dynamical Allocation of Nodes 16 1.5 Shadow Copies of Array-Based Structures 18 2 Search Trees 23 2.1 Two Models of Search Trees 23 2.2 General Properties and Transformations 26 2.3 Height of a Search Tree 29 2.4 Basic Find, Insert, and Delete 31 2.5ReturningfromLeaftoRoot35 2.6 Dealing with Nonunique Keys 37 2.7 Queries for the Keys in an Interval 38 2.8 Building Optimal Search Trees 40 2.9 Converting Trees into Lists 47 2.10
    [Show full text]
  • Search Trees
    Lecture III Page 1 “Trees are the earth’s endless effort to speak to the listening heaven.” – Rabindranath Tagore, Fireflies, 1928 Alice was walking beside the White Knight in Looking Glass Land. ”You are sad.” the Knight said in an anxious tone: ”let me sing you a song to comfort you.” ”Is it very long?” Alice asked, for she had heard a good deal of poetry that day. ”It’s long.” said the Knight, ”but it’s very, very beautiful. Everybody that hears me sing it - either it brings tears to their eyes, or else -” ”Or else what?” said Alice, for the Knight had made a sudden pause. ”Or else it doesn’t, you know. The name of the song is called ’Haddocks’ Eyes.’” ”Oh, that’s the name of the song, is it?” Alice said, trying to feel interested. ”No, you don’t understand,” the Knight said, looking a little vexed. ”That’s what the name is called. The name really is ’The Aged, Aged Man.’” ”Then I ought to have said ’That’s what the song is called’?” Alice corrected herself. ”No you oughtn’t: that’s another thing. The song is called ’Ways and Means’ but that’s only what it’s called, you know!” ”Well, what is the song then?” said Alice, who was by this time completely bewildered. ”I was coming to that,” the Knight said. ”The song really is ’A-sitting On a Gate’: and the tune’s my own invention.” So saying, he stopped his horse and let the reins fall on its neck: then slowly beating time with one hand, and with a faint smile lighting up his gentle, foolish face, he began..
    [Show full text]
  • The Random Access Zipper: Simple, Purely-Functional Sequences
    The Random Access Zipper: Simple, Purely-Functional Sequences Kyle Headley and Matthew A. Hammer University of Colorado Boulder [email protected], [email protected] Abstract. We introduce the Random Access Zipper (RAZ), a simple, purely-functional data structure for editable sequences. The RAZ com- bines the structure of a zipper with that of a tree: like a zipper, edits at the cursor require constant time; by leveraging tree structure, relocating the edit cursor in the sequence requires log time. While existing data structures provide these time bounds, none do so with the same simplic- ity and brevity of code as the RAZ. The simplicity of the RAZ provides the opportunity for more programmers to extend the structure to their own needs, and we provide some suggestions for how to do so. 1 Introduction The singly-linked list is the most common representation of sequences for func- tional programmers. This structure is considered a core primitive in every func- tional language, and morever, the principles of its simple design recur througout user-defined structures that are \sequence-like". Though simple and ubiquitous, the functional list has a serious shortcoming: users may only efficiently access and edit the head of the list. In particular, random accesses (or edits) generally require linear time. To overcome this problem, researchers have developed other data structures representing (functional) sequences, most notably, finger trees [8]. These struc- tures perform well, allowing edits in (amortized) constant time and moving the edit location in logarithmic time. More recently, researchers have proposed the RRB-Vector [14], offering a balanced tree representation for immutable vec- tors.
    [Show full text]
  • Design of Data Structures for Mergeable Trees∗
    Design of Data Structures for Mergeable Trees∗ Loukas Georgiadis1; 2 Robert E. Tarjan1; 3 Renato F. Werneck1 Abstract delete(v): Delete leaf v from the forest. • Motivated by an application in computational topology, merge(v; w): Given nodes v and w, let P be the path we consider a novel variant of the problem of efficiently • from v to the root of its tree, and let Q be the path maintaining dynamic rooted trees. This variant allows an from w to the root of its tree. Restructure the tree operation that merges two tree paths. In contrast to the or trees containing v and w by merging the paths P standard problem, in which only one tree arc at a time and Q in a way that preserves the heap order. The changes, a single merge operation can change many arcs. merge order is unique if all node labels are distinct, In spite of this, we develop a data structure that supports which we can assume without loss of generality: if 2 merges and all other standard tree operations in O(log n) necessary, we can break ties by node identifier. See amortized time on an n-node forest. For the special case Figure 1. that occurs in the motivating application, in which arbitrary arc deletions are not allowed, we give a data structure with 1 an O(log n) amortized time bound per operation, which is merge(6,11) asymptotically optimal. The analysis of both algorithms is 3 2 not straightforward and requires ideas not previously used in 6 7 4 5 the study of dynamic trees.
    [Show full text]
  • Optimal Finger Search Trees in the Pointer Machine
    Alcom-FT Technical Report Series ALCOMFT-TR-02-77 Optimal Finger Search Trees in the Pointer Machine Gerth Stølting Brodal∗ George Lagogiannis† Christos Makris† Athanasios Tsakalidis† Kostas Tsichlas† Abstract We develop a new finger search tree with worst-case constant update time in the Pointer Machine (PM) model of computation. This was a major problem in the field of Data Structures and was tantalizingly open for over twenty years while many attempts by researchers were made to solve it. The result comes as a consequence of the innovative mechanism that guides the rebalancing operations combined with incremental multiple splitting and fusion techniques over nodes. Keywords balanced trees, update operations, finger search trees, data structures, complexity 1 Introduction The balanced search tree is one of the most common data structures used in algorithms. Assuming that the update position is known, balanced search trees with O(1) amortized update time have been presented long ago ([6, 14]). It has also been known ([6, 16]) that updates can be performed in O(1) structural changes, but the nodes to be changed have to be searched in Ω(log n) time. Levcopoulos and Overmars ([13]) presented an algorithm achieving O(1) worst case update time by using a global splitting lemma that is based on a pebble game combined with the bucketing technique of Overmars ([14]). Instead of storing single keys in the leaves of the search tree, each leaf can store a list of several keys. Unfortunately, the buckets in [13] have size O(log2 n), so they need a two level hierarchy of lists in order to guarantee O(log n) query time within the buckets.
    [Show full text]
  • Space-Efficient Data Structures, Streams, and Algorithms
    Andrej Brodnik Alejandro López-Ortiz Venkatesh Raman Alfredo Viola (Eds.) Festschrift Space-Efficient Data Structures, Streams, LNCS 8066 and Algorithms Papers in Honor of J. Ian Munro on the Occasion of His 66th Birthday 123 Lecture Notes in Computer Science 8066 Commenced Publication in 1973 Founding and Former Series Editors: Gerhard Goos, Juris Hartmanis, and Jan van Leeuwen Editorial Board David Hutchison Lancaster University, UK Takeo Kanade Carnegie Mellon University, Pittsburgh, PA, USA Josef Kittler University of Surrey, Guildford, UK Jon M. Kleinberg Cornell University, Ithaca, NY, USA Alfred Kobsa University of California, Irvine, CA, USA Friedemann Mattern ETH Zurich, Switzerland John C. Mitchell Stanford University, CA, USA Moni Naor Weizmann Institute of Science, Rehovot, Israel Oscar Nierstrasz University of Bern, Switzerland C. Pandu Rangan Indian Institute of Technology, Madras, India Bernhard Steffen TU Dortmund University, Germany Madhu Sudan Microsoft Research, Cambridge, MA, USA Demetri Terzopoulos University of California, Los Angeles, CA, USA Doug Tygar University of California, Berkeley, CA, USA Gerhard Weikum Max Planck Institute for Informatics, Saarbruecken, Germany Andrej Brodnik Alejandro López-Ortiz Venkatesh Raman Alfredo Viola (Eds.) Space-Efficient Data Structures, Streams, and Algorithms Papers in Honor of J. Ian Munro on the Occasion of His 66th Birthday 13 Volume Editors Andrej Brodnik University of Ljubljana, Faculty of Computer and Information Science Ljubljana, Slovenia and University of Primorska,
    [Show full text]
  • Finger Search Trees
    11 Finger Search Trees 11.1 Finger Searching....................................... 11-1 11.2 Dynamic Finger Search Trees ....................... 11-2 11.3 Level Linked (2,4)-Trees .............................. 11-3 11.4 Randomized Finger Search Trees ................... 11-4 Treaps • Skip Lists 11.5 Applications............................................ 11-6 Optimal Merging and Set Operations • Arbitrary Gerth Stølting Brodal Merging Order • List Splitting • Adaptive Merging and University of Aarhus Sorting 11.1 Finger Searching One of the most studied problems in computer science is the problem of maintaining a sorted sequence of elements to facilitate efficient searches. The prominent solution to the problem is to organize the sorted sequence as a balanced search tree, enabling insertions, deletions and searches in logarithmic time. Many different search trees have been developed and studied intensively in the literature. A discussion of balanced binary search trees can e.g. be found in [4]. This chapter is devoted to finger search trees which are search trees supporting fingers, i.e. pointers, to elements in the search trees and supporting efficient updates and searches in the vicinity of the fingers. If the sorted sequence is a static set of n elements then a simple and space efficient representation is a sorted array. Searches can be performed by binary search using 1+⌊log n⌋ comparisons (we throughout this chapter let log x denote log2 max{2, x}). A finger search starting at a particular element of the array can be performed by an exponential search by inspecting elements at distance 2i − 1 from the finger for increasing i followed by a binary search in a range of 2⌊log d⌋ − 1 elements, where d is the rank difference in the sequence between the finger and the search element.
    [Show full text]
  • An..Time Algorithm for Triangulating
    SIAM J. COMPUT. (C) 1988 Society tbr Industrial and Applied Mathematics Voi. 17, No. I, February 1988 010 AN O(n log log n)-TIME ALGORITHM FOR TRIANGULATING A SIMPLE POLYGON* ROBERT E. TARJANf* AND CHRISTOPHER J. VAN WYK" Abstract. Given a simple n-vertex polygon, the triangulation problem is to partition the interior of the polygon into n-2 triangles by adding n-3 nonintersecting diagonals. We propose an O(n log logn)-time algorithm for this problem, improving on the previously best bound of O (n log n) and showing that triangu- lation is not as hard as sorting. Improved algorithms for several other computational geometry problems, including testing whether a polygon is simple, follow from our result. Key words, amortized time, balanced divide and conquer, heterogeneous finger search tree, homogene- ous finger search tree, horizontal visibility information, Jordan sorting with error-correction, simplicity test- ing AMS(MOS) subject classifications. 51M15, 68P05, 68Q25 1. Introduction. Let P be an n-vertex simple polygon, defined by a list Vo,V vn- of its vertices in clockwise order around the boundary. (The interior of the polygon is to the right as one walks clockwise around the boundary.) We denote the boundary of P by 0P. We assume throughout this paper (without loss of generality) that the vertices of P have distinct y-coordinates. For convenience we define vn V o. The edges of P are the open line segments whose endpoints are vi,vi+l for 0 < < n. The diagonals of P are the open line segments whose endpoints are vertices and that lie entirely in the interior of P.
    [Show full text]
  • Biased Finger Trees and Three-Dimensional Layers of Maxima
    Purdue University Purdue e-Pubs Department of Computer Science Technical Reports Department of Computer Science 1993 Biased Finger Trees and Three-Dimensional Layers of Maxima Mikhail J. Atallah Purdue University, [email protected] Michael T. Goodrich Kumar Ramaiyer Report Number: 93-035 Atallah, Mikhail J.; Goodrich, Michael T.; and Ramaiyer, Kumar, "Biased Finger Trees and Three- Dimensional Layers of Maxima" (1993). Department of Computer Science Technical Reports. Paper 1052. https://docs.lib.purdue.edu/cstech/1052 This document has been made available through Purdue e-Pubs, a service of the Purdue University Libraries. Please contact [email protected] for additional information. HlASED FINGER TREES AND THREE-DIMENSIONAL LAYERS OF MAXIMA Mikhnil J. Atallah Michael T. Goodrich Kumar Ramaiyer eSD TR-9J-035 June 1993 (Revised 3/94) (Revised 4/94) Biased Finger Trees and Three-Dimensional Layers of Maxima Mikhail J. Atallah" Michael T. Goodricht Kumar Ramaiyert Dept. of Computer Sciences Dept. of Computer Science Dept. of Computer Science Purdue University Johns Hopkins University Johns Hopkins University W. Lafayette, IN 47907-1398 Baltimore, MD 21218-2694 Baltimore, MD 21218-2694 mjalDcs.purdue.edu goodrich~cs.jhu.edu kumarlDcs . j hu. edu Abstract We present a. method for maintaining biased search trees so as to support fast finger updates (i.e., updates in which one is given a pointer to the part of the hee being changed). We illustrate the power of such biased finger trees by showing how they can be used to derive an optimal O(n log n) algorithm for the 3-dimcnsionallayers-of-maxima problem and also obtain an improved method for dynamic point location.
    [Show full text]