Range & Windowing Queries (2 Lectures)

Total Page:16

File Type:pdf, Size:1020Kb

Range & Windowing Queries (2 Lectures) Range & windowing queries 1/180 Geometric Algorithms Range & windowing queries (2 lectures) Database queries 2/180 G. Ometer born: Aug 16, 1954 salary salary: $3,500 A database query may ask for all employees with age between a1 and a2, and salary between s1 and s2 19,500,000 19,559,999 date of birth Data structures 3/180 Idea of data structures I Representation of structure, for convenience (like DCEL) I Preprocessing of data, to be able to solve future questions really fast (sub-linear time) A (search) data structure has a storage requirement, a query time, and a construction time (and an update time) 1D range query problem 4/180 1D range query problem: Preprocess a set of n points on the real line such that the ones inside a 1D query range (interval) can be answered fast The points p1;:::; pn are known beforehand, the query [x;x0] only later A solution to a query problem is a data structure, a query algorithm, and a construction algorithm Question: What are the most important factors for the efficiency of a solution? Balanced binary search trees 5/180 A balanced binary search tree with the points in the leaves 49 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 Balanced binary search trees 6/180 The search path for 25 49 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 Balanced binary search trees 7/180 The search paths for 25 and for 90 49 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 Example 1D range query 8/180 A 1-dimensional range query with [25; 90] 49 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 Node types for a query 9/180 Three types of nodes for a given query: I White nodes: never visited by the query I Grey nodes: visited by the query, unclear if they lead to output I Black nodes: visited by the query, whole subtree is output Question: What query time do we hope for? Node types for a query 10/180 The query algorithm comes down to what we do at each type of node Grey nodes: use query range to decide how to proceed: to not visit a subtree (pruning), to report a complete subtree, or just continue Black nodes: traverse and enumerate all points in the leaves Example 1D range query 11/180 A 1-dimensional range query with [61; 90] 49 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 Example 1D range query 12/180 A 1-dimensional range query with [61; 90] 49 split node 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 1D range query algorithm 13/180 Algorithm 1DRANGEQUERY(T;[x : x0]) 1. nsplit FINDSPLITNODE(T;x;x0) 2. if nsplit is a leaf 3. then Check if the point in nsplit must be reported. 4. else n lc(nsplit) 5. while n is not a leaf 6. do if x xn ≤ 7. then REPORTSUBTREE(rc(n)) 8. n lc(n) 9. else n rc(n) 10. Check if the point stored in n must be reported. 11. Similarly, follow the path to x0, and ::: Query time analysis 14/180 The efficiency analysis is based on counting the numbers of nodes visited for each type I White nodes: never visited by the query; no time spent I Grey nodes: visited by the query, unclear if they lead to output; time determines dependency on n I Black nodes: visited by the query, whole subtree is output; time determines dependency on k, the output size Query time analysis 15/180 Grey nodes: they occur on only two paths in the tree, and since the tree is balanced, its depth is O(logn) Black nodes: a (sub)tree with m leaves has m 1 internal − nodes; traversal visits O(m) nodes and finds m points for the output The time spent at each node is O(1) O(logn + k) query time ) Storage requirement and preprocessing 16/180 A (balanced) binary search tree storing n points uses O(n) storage A balanced binary search tree storing n points can be built in O(n) time after sorting Result 17/180 Theorem: A set of n points on the real line can be preprocessed in O(nlogn) time into a data structure of O(n) size so that any 1D range query can be answered in O(logn + k) time, where k is the number of answers reported quadtrees: good in practice, but not so good worst-case query time Kd-trees: queries take O(pn + k) (Chapter 5.2) range trees: today Range queries in 2D 18/180 Range queries in 2D 18/180 quadtrees: good in practice, but not so good worst-case query time Kd-trees: queries take O(pn + k) (Chapter 5.2) range trees: today Back to 1D range queries 19/180 A 1-dimensional range query with [61; 90] 49 split node 23 80 10 37 62 89 3 19 30 49 59 70 89 93 3 10 19 23 30 37 59 62 70 80 93 97 Examining 1D range queries 20/180 Observation: Ignoring the search path leaves, all answers are jointly represented by the highest nodes strictly between the two search paths Question: How many highest nodes between the search paths can there be? Examining 1D range queries 21/180 For any 1D range query, we can identify O(logn) nodes that together represent all answers to a 1D range query Toward 2D range queries 22/180 For any 2d range query, we can identify O(logn) nodes that together represent all points that have a correct first coordinate Toward 2D range queries 23/180 (1, 5) (3, 8) (4, 2) (5, 9) (6, 7) (7, 3) (8, 1) (9, 4) Toward 2D range queries 24/180 (1, 5) (3, 8) (4, 2) (5, 9) (6, 7) (7, 3) (8, 1) (9, 4) Toward 2D range queries 25/180 data structure for searching on y-coordinate (1, 5) (3, 8) (4, 2) (5, 9) (6, 7) (7, 3) (8, 1) (9, 4) Toward 2D range queries 26/180 (5, 9) (3, 8) (6, 7) (1, 5) (9, 4) (7, 3) (4, 2) (8, 1) (1, 5) (3, 8) (4, 2) (5, 9) (6, 7) (7, 3) (8, 1) (9, 4) 2D range trees 27/180 Every internal node stores a whole tree in an associated structure, on y-coordinate Question: How much storage does this take? Storage of 2D range trees 28/180 To analyze storage, two arguments can be used: I By level: On each level, any point is stored exactly once. So all associated trees on one level together have O(n) size I By point: For any point, it is stored in the associated structures of its search path. So it is stored in O(logn) of them Construction algorithm 29/180 Algorithm BUILD2DRANGETREE(P) 1. Construct the associated structure: Build a binary search tree Tassoc on the set Py of y-coordinates in P 2. if P contains only one point 3. then Create a leaf n storing this point, and make Tassoc the associated structure of n. 4. else Split P into Pleft and Pright, the subsets and > ≤ the median x-coordinate xmid 5. nleft BUILD2DRANGETREE(Pleft) 6. nright BUILD2DRANGETREE(Pright) 7. Create a node n storing xmid, make nleft the left child of n, make nright the right child of n, and make Tassoc the associated structure of n 8. return n Efficiency of construction 30/180 The construction algorithm takes O(nlog2 n) time T(1) = O(1) T(n) = 2 T(n=2) + O(nlogn) · which solves to O(nlog2 n) time Efficiency of construction 31/180 Suppose we pre-sort P on y-coordinate, and whenever we split P into Pleft and Pright, we keep the y-order in both subsets For a sorted set, the associated structure can be built in linear time Efficiency of construction 32/180 The adapted construction algorithm takes O(nlogn) time T(1) = O(1) T(n) = 2 T(n=2) + O(n) · which solves to O(nlogn) time 2D range queries 33/180 How are queries performed and why are they correct? I Are we sure that each answer is found? I Are we sure that the same point is found only once? 2D range queries 34/180 ν p p µ µ0 p p Query algorithm 35/180 Algorithm 2DRANGEQUERY(T;[x : x ] [y : y ]) 0 × 0 1. nsplit FINDSPLITNODE(T;x;x0) 2. if nsplit is a leaf 3. then report the point stored at nsplit, if an answer 4. else n lc(nsplit) 5. while n is not a leaf 6. do if x xn ≤ 7. then 1DRANGEQ(Tassoc(rc(n));[y : y0]) 8. n lc(n) 9. else n rc(n) 10. Check if the point stored at n must be reported. 11. Similarly, follow the path from rc(nsplit) to x0 ::: 2D range query time 36/180 Question: How much time does a 2D range query take? Subquestions: In how many associated structures do we search? How much time does each such search take? 2D range queries 37/180 ν µ µ0 2D range query efficiency 38/180 We search in O(logn) associated structures to perform a 1D range query; at most two per level of the main tree The query time is O(logn) O(logm + k ), or × 0 ∑O(lognn + kn ) n where ∑kn = k the number of points reported 2D range query efficiency 39/180 Use the concept of grey and black nodes again: 2D range query efficiency 40/180 The number of grey nodes is O(log2 n) The number of black nodes is O(k) if k points are reported The query time is O(log2 n + k), where k is the size of the output Result 41/180 Theorem: A set of n points in the plane can be preprocessed in O(nlogn) time into a data structure of O(nlogn) size so that any 2D range query can be answered in O(log2 n + k) time, where k is the number of answers reported In contrast, a kd-tree has O(n) size and answers queries in O(pn + k) time (Chapter 5.2).
Recommended publications
  • Interval Trees Storing and Searching Intervals
    Interval Trees Storing and Searching Intervals • Instead of points, suppose you want to keep track of axis-aligned segments: • Range queries: return all segments that have any part of them inside the rectangle. • Motivation: wiring diagrams, genes on genomes Simpler Problem: 1-d intervals • Segments with at least one endpoint in the rectangle can be found by building a 2d range tree on the 2n endpoints. - Keep pointer from each endpoint stored in tree to the segments - Mark segments as you output them, so that you don’t output contained segments twice. • Segments with no endpoints in range are the harder part. - Consider just horizontal segments - They must cross a vertical side of the region - Leads to subproblem: Given a vertical line, find segments that it crosses. - (y-coords become irrelevant for this subproblem) Interval Trees query line interval Recursively build tree on interval set S as follows: Sort the 2n endpoints Let xmid be the median point Store intervals that cross xmid in node N intervals that are intervals that are completely to the completely to the left of xmid in Nleft right of xmid in Nright Another view of interval trees x Interval Trees, continued • Will be approximately balanced because by choosing the median, we split the set of end points up in half each time - Depth is O(log n) • Have to store xmid with each node • Uses O(n) storage - each interval stored once, plus - fewer than n nodes (each node contains at least one interval) • Can be built in O(n log n) time. • Can be searched in O(log n + k) time [k = #
    [Show full text]
  • 14 Augmenting Data Structures
    14 Augmenting Data Structures Some engineering situations require no more than a “textbook” data struc- ture—such as a doubly linked list, a hash table, or a binary search tree—but many others require a dash of creativity. Only in rare situations will you need to cre- ate an entirely new type of data structure, though. More often, it will suffice to augment a textbook data structure by storing additional information in it. You can then program new operations for the data structure to support the desired applica- tion. Augmenting a data structure is not always straightforward, however, since the added information must be updated and maintained by the ordinary operations on the data structure. This chapter discusses two data structures that we construct by augmenting red- black trees. Section 14.1 describes a data structure that supports general order- statistic operations on a dynamic set. We can then quickly find the ith smallest number in a set or the rank of a given element in the total ordering of the set. Section 14.2 abstracts the process of augmenting a data structure and provides a theorem that can simplify the process of augmenting red-black trees. Section 14.3 uses this theorem to help design a data structure for maintaining a dynamic set of intervals, such as time intervals. Given a query interval, we can then quickly find an interval in the set that overlaps it. 14.1 Dynamic order statistics Chapter 9 introduced the notion of an order statistic. Specifically, the ith order statistic of a set of n elements, where i 2 f1;2;:::;ng, is simply the element in the set with the ith smallest key.
    [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]
  • Computational Geometry: 1D Range Tree, 2D Range Tree, Line
    Computational Geometry Lecture 17 Computational geometry Algorithms for solving “geometric problems” in 2D and higher. Fundamental objects: point line segment line Basic structures: point set polygon L17.2 Computational geometry Algorithms for solving “geometric problems” in 2D and higher. Fundamental objects: point line segment line Basic structures: triangulation convex hull L17.3 Orthogonal range searching Input: n points in d dimensions • E.g., representing a database of n records each with d numeric fields Query: Axis-aligned box (in 2D, a rectangle) • Report on the points inside the box: • Are there any points? • How many are there? • List the points. L17.4 Orthogonal range searching Input: n points in d dimensions Query: Axis-aligned box (in 2D, a rectangle) • Report on the points inside the box Goal: Preprocess points into a data structure to support fast queries • Primary goal: Static data structure • In 1D, we will also obtain a dynamic data structure supporting insert and delete L17.5 1D range searching In 1D, the query is an interval: First solution using ideas we know: • Interval trees • Represent each point x by the interval [x, x]. • Obtain a dynamic structure that can list k answers in a query in O(k lg n) time. L17.6 1D range searching In 1D, the query is an interval: Second solution using ideas we know: • Sort the points and store them in an array • Solve query by binary search on endpoints. • Obtain a static structure that can list k answers in a query in O(k + lg n) time. Goal: Obtain a dynamic structure that can list k answers in a query in O(k + lg n) time.
    [Show full text]
  • Range Searching
    Range Searching ² Data structure for a set of objects (points, rectangles, polygons) for efficient range queries. Y Q X ² Depends on type of objects and queries. Consider basic data structures with broad applicability. ² Time-Space tradeoff: the more we preprocess and store, the faster we can solve a query. ² Consider data structures with (nearly) linear space. Subhash Suri UC Santa Barbara Orthogonal Range Searching ² Fix a n-point set P . It has 2n subsets. How many are possible answers to geometric range queries? Y 5 Some impossible rectangular ranges 6 (1,2,3), (1,4), (2,5,6). 1 4 Range (1,5,6) is possible. 3 2 X ² Efficiency comes from the fact that only a small fraction of subsets can be formed. ² Orthogonal range searching deals with point sets and axis-aligned rectangle queries. ² These generalize 1-dimensional sorting and searching, and the data structures are based on compositions of 1-dim structures. Subhash Suri UC Santa Barbara 1-Dimensional Search ² Points in 1D P = fp1; p2; : : : ; png. ² Queries are intervals. 15 71 3 7 9 21 23 25 45 70 72 100 120 ² If the range contains k points, we want to solve the problem in O(log n + k) time. ² Does hashing work? Why not? ² A sorted array achieves this bound. But it doesn’t extend to higher dimensions. ² Instead, we use a balanced binary tree. Subhash Suri UC Santa Barbara Tree Search 15 7 24 3 12 20 27 1 4 9 14 17 22 25 29 1 3 4 7 9 12 14 15 17 20 22 24 25 27 29 31 u v xlo =2 x hi =23 ² Build a balanced binary tree on the sorted list of points (keys).
    [Show full text]
  • I/O-Efficient Spatial Data Structures for Range Queries
    I/O-Efficient Spatial Data Structures for Range Queries Lars Arge Kasper Green Larsen MADALGO,∗ Department of Computer Science, Aarhus University, Denmark E-mail: [email protected],[email protected] 1 Introduction Range reporting is a one of the most fundamental topics in spatial databases and computational geometry. In this class of problems, the input consists of a set of geometric objects, such as points, line segments, rectangles etc. The goal is to preprocess the input set into a data structure, such that given a query range, one can efficiently report all input objects intersecting the range. The ranges most commonly considered are axis-parallel rectangles, halfspaces, points, simplices and balls. In this survey, we focus on the planar orthogonal range reporting problem in the external memory model of Aggarwal and Vitter [2]. Here the input consists of a set of N points in the plane, and the goal is to support reporting all points inside an axis-parallel query rectangle. We use B to denote the disk block size in number of points. The cost of answering a query is measured in the number of I/Os performed and the space of the data structure is measured in the number of disk blocks occupied, hence linear space is O(N=B) disk blocks. Outline. In Section 2, we set out by reviewing the classic B-tree for solving one- dimensional orthogonal range reporting, i.e. given N points on the real line and a query interval q = [q1; q2], report all T points inside q. In Section 3 we present optimal solutions for planar orthogonal range reporting, and finally in Section 4, we briefly discuss related range searching problems.
    [Show full text]
  • Parallel Range, Segment and Rectangle Queries with Augmented Maps
    Parallel Range, Segment and Rectangle Queries with Augmented Maps Yihan Sun Guy E. Blelloch Carnegie Mellon University Carnegie Mellon University [email protected] [email protected] Abstract The range, segment and rectangle query problems are fundamental problems in computational geometry, and have extensive applications in many domains. Despite the significant theoretical work on these problems, efficient implementations can be complicated. We know of very few practical implementations of the algorithms in parallel, and most implementations do not have tight theoretical bounds. In this paper, we focus on simple and efficient parallel algorithms and implementations for range, segment and rectangle queries, which have tight worst-case bound in theory and good parallel performance in practice. We propose to use a simple framework (the augmented map) to model the problem. Based on the augmented map interface, we develop both multi-level tree structures and sweepline algorithms supporting range, segment and rectangle queries in two dimensions. For the sweepline algorithms, we also propose a parallel paradigm and show corresponding cost bounds. All of our data structures are work-efficient to build in theory (O(n log n) sequential work) and achieve a low parallel depth (polylogarithmic for the multi-level tree structures, and O(n) for sweepline algorithms). The query time is almost linear to the output size. We have implemented all the data structures described in the paper using a parallel augmented map library. Based on the library each data structure only requires about 100 lines of C++ code. We test their performance on large data sets (up to 108 elements) and a machine with 72-cores (144 hyperthreads).
    [Show full text]
  • 2 Dynamization
    6.851: Advanced Data Structures Spring 2010 Lecture 4 — February 11, 2010 Prof. Andr´eSchulz Scribe: Peter Caday 1 Overview In the previous lecture, we studied range trees and kd-trees, two structures which support efficient orthogonal range queries on a set of points. In this second of four lectures on geometric data structures, we will tie up a loose end from the last lecture — handling insertions and deletions. The main topic, however, will be two new structures addressing the vertical line stabbing problem: interval trees and segment trees. We will conclude with an application of vertical line stabbing to a windowing problem. 2 Dynamization In our previous discussion of range trees, we assumed that the point set was static. On the other hand, we may be interested in supporting insertions and deletions as time progresses. Unfortunately, it is not trivial to modify our data structures to handle this dynamic scenario. We can, however, dynamize them using general techniques; the techniques and their application here are due to Overmars [1]. Idea. Overmars’ dynamization is based on the idea of decomposable searches. A search (X,q) for the value q among the keys X is decomposable if the search result can be obtained in O(1) time from the results of searching (X1,q) and (X2,q), where X1 ∪ X2 = X. For instance, in the 2D kd-tree, the root node splits R2 into two halves. If we want to search for all points lying in a rectangle q, we may do this by combining the results of searching for q in each half.
    [Show full text]
  • Lecture Notes of CSCI5610 Advanced Data Structures
    Lecture Notes of CSCI5610 Advanced Data Structures Yufei Tao Department of Computer Science and Engineering Chinese University of Hong Kong July 17, 2020 Contents 1 Course Overview and Computation Models 4 2 The Binary Search Tree and the 2-3 Tree 7 2.1 The binary search tree . .7 2.2 The 2-3 tree . .9 2.3 Remarks . 13 3 Structures for Intervals 15 3.1 The interval tree . 15 3.2 The segment tree . 17 3.3 Remarks . 18 4 Structures for Points 20 4.1 The kd-tree . 20 4.2 A bootstrapping lemma . 22 4.3 The priority search tree . 24 4.4 The range tree . 27 4.5 Another range tree with better query time . 29 4.6 Pointer-machine structures . 30 4.7 Remarks . 31 5 Logarithmic Method and Global Rebuilding 33 5.1 Amortized update cost . 33 5.2 Decomposable problems . 34 5.3 The logarithmic method . 34 5.4 Fully dynamic kd-trees with global rebuilding . 37 5.5 Remarks . 39 6 Weight Balancing 41 6.1 BB[α]-trees . 41 6.2 Insertion . 42 6.3 Deletion . 42 6.4 Amortized analysis . 42 6.5 Dynamization with weight balancing . 43 6.6 Remarks . 44 1 CONTENTS 2 7 Partial Persistence 47 7.1 The potential method . 47 7.2 Partially persistent BST . 48 7.3 General pointer-machine structures . 52 7.4 Remarks . 52 8 Dynamic Perfect Hashing 54 8.1 Two random graph results . 54 8.2 Cuckoo hashing . 55 8.3 Analysis . 58 8.4 Remarks . 59 9 Binomial and Fibonacci Heaps 61 9.1 The binomial heap .
    [Show full text]
  • Uwaterloo Latex Thesis Template
    In-Memory Storage for Labeled Tree-Structured Data by Gelin Zhou A thesis presented to the University of Waterloo in fulfillment of the thesis requirement for the degree of Doctor of Philosophy in Computer Science Waterloo, Ontario, Canada, 2017 c Gelin Zhou 2017 Examining Committee Membership The following served on the Examining Committee for this thesis. The decision of the Examining Committee is by majority vote. Johannes Fischer External Examiner Professor J. Ian Munro Supervisor Professor Meng He Co-Supervisor Assistant Professor Gordon V. Cormack Internal Examiner Professor Therese Biedl Internal Examiner Professor Gordon B. Agnew Internal-external Examiner Associate Professor ii I hereby declare that I am the sole author of this thesis. This is a true copy of the thesis, including any required final revisions, as accepted by my examiners. I understand that my thesis may be made electronically available to the public. iii Abstract In this thesis, we design in-memory data structures for labeled and weights trees, so that various types of path queries or operations can be supported with efficient query time. We assume the word RAM model with word size w, which permits random accesses to w-bit memory cells. Our data structures are space-efficient and many of them are even succinct. These succinct data structures occupy space close to the information theoretic lower bounds of the input trees within lower order terms. First, we study the problems of supporting various path queries over weighted trees. A path counting query asks for the number of nodes on a query path whose weights lie within a query range, while a path reporting query requires to report these nodes.
    [Show full text]