PR Quadtree Geographical Data Structure. Background The structure of a BST is determined by the order of the data Depending on the order we can get either.

Slides:



Advertisements
Similar presentations
Nearest Neighbor Search
Advertisements

Special Purpose Trees: Tries and Height Balanced Trees CS 400/600 – Data Structures.
1 AVL-Trees (Adelson-Velskii & Landis, 1962) In normal search trees, the complexity of find, insert and delete operations in search trees is in the worst.
1 AVL Trees (10.2) CSE 2011 Winter April 2015.
Chapter 4: Trees Part II - AVL Tree
CPSC 252 AVL Trees Page 1 AVL Trees Motivation: We have seen that when data is inserted into a BST in sorted order, the BST contains only one branch (it.
Trees Types and Operations
CS144: Spatial Index. Example Dataset Grid File (2 points per bucket)
Searching on Multi-Dimensional Data
Binary Trees Chapter 6. Linked Lists Suck By now you realize that the title to this slide is true… By now you realize that the title to this slide is.
Spatial indexing PAMs (II).
Insert A tree starts with the dummy node D D 200 D 7 Insert D
Spatial Information Systems (SIS) COMP Raster-based structures (1)
Spatial Indexing I Point Access Methods.
Tirgul 5 Comparators AVL trees. Comparators You already know interface Comparable which is used to compare objects. By implementing the interface, one.
Tirgul 6 B-Trees – Another kind of balanced trees Problem set 1 - some solutions.
Tirgul 5 This tirgul is about AVL trees. You will implement this in prog-ex2, so pay attention... BTW - prog-ex2 is on the web. Start working on it!
1 Section 9.2 Tree Applications. 2 Binary Search Trees Goal is implementation of an efficient searching algorithm Binary Search Tree: –binary tree in.
Spatial Information Systems (SIS) COMP Spatial access methods: Indexing (part 2)
Multimedia Databases Chapter 4.
Binary Search Trees Chapter 7 Objectives
By : Budi Arifitama Pertemuan ke Objectives Upon completion you will be able to: Create and implement binary search trees Understand the operation.
1 Multiway trees & B trees & 2_4 trees Go&Ta Chap 10.
B-trees (Balanced Trees) A B-tree is a special kind of tree, similar to a binary tree. However, It is not a binary search tree. It is not a binary tree.
Storage CMSC 461 Michael Wilson. Database storage  At some point, database information must be stored in some format  It’d be impossible to store hundreds.
1 TK1924 Program Design & Problem Solving Session 2011/2012 L8: Binary Trees.
AVL Trees Neil Ghani University of Strathclyde. General Trees Recall a tree is * A leaf storing an integer * A node storing a left subtree, an integer.
Data Structures IS 101Y/CMSC 101 Computational Thinking and Design Thursday, October 3, 2013 Marie desJardins University of Maryland, Baltimore County.
A Binary Search Tree Binary Search Trees.
Course notes CS2606: Data Structures and Object-Oriented Development Ryan Richardson John Paul Vergara Department of Computer Science Virginia Tech Spring.
CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
AVL Trees. AVL Node Structure The AVL node structure follows the same structure as the binary search tree, with the addition of a term to store the.
AVL Trees Opening Discussion zWhat did we talk about last class? zDo you have any questions about the assignments? zYour minute essay last.
Week 12 - Wednesday.  What did we talk about last time?  Matching  Stable marriage  Started Euler paths.
CS 206 Introduction to Computer Science II 09 / 26 / 2008 Instructor: Michael Eckmann.
1 Chapter 7 Objectives Upon completion you will be able to: Create and implement binary search trees Understand the operation of the binary search tree.
Binary Search Trees (BSTs) 18 February Binary Search Tree (BST) An important special kind of binary tree is the BST Each node stores some information.
Spatial Indexing Techniques Introduction to Spatial Computing CSE 5ISC Some slides adapted from Spatial Databases: A Tour by Shashi Shekhar Prentice Hall.
Data Structures Using C++ 2E Chapter 11 Binary Trees.
CS 367 Introduction to Data Structures Lecture 8.
8/3/2007CMSC 341 BTrees1 CMSC 341 B- Trees D. Frey with apologies to Tom Anastasio.
Question 4 Tutorial 8. Part A Insert 20, 10, 15, 5,7, 30, 25, 18, 37, 12 and 40 in sequence into an empty binary tree
ITEC 2620M Introduction to Data Structures Instructor: Prof. Z. Yang Course Website: ec2620m.htm Office: TEL 3049.
CSE332: Data Abstractions Lecture 7: AVL Trees
File Organization and Processing Week 3
Week 7 - Friday CS221.
CSC212 Data Structure - Section AB
CSE373: Data Structures & Algorithms Lecture 7: AVL Trees
Red-Black Trees.
Lecture 22 Binary Search Trees Chapter 10 of textbook
Red-Black Trees Bottom-Up Deletion.
Binary Search Trees Why this is a useful data structure. Terminology
CSE373: Data Structures & Algorithms Lecture 7: AVL Trees
Data Structures Using C++ 2E
PROSE CS 218 Fall 2017.
CMSC 341 Lecture 10 B-Trees Based on slides from Dr. Katherine Gibson.
Tree A tree is a data structure in which each node is comprised of some data as well as node pointers to child nodes
Quadtrees 1.
B- Trees D. Frey with apologies to Tom Anastasio
B- Trees D. Frey with apologies to Tom Anastasio
CSE373: Data Structures & Algorithms Lecture 5: AVL Trees
Random inserting into a B+ Tree
CSE 332: Data Abstractions AVL Trees
Lecture No.20 Data Structures Dr. Sohail Aslam
B- Trees D. Frey with apologies to Tom Anastasio
Richard Anderson Spring 2016
Multidimensional Search Structures
Goals Design decisions Design Insertion
1 Lecture 13 CS2013.
Data Structures Using C++ 2E
Presentation transcript:

PR Quadtree Geographical Data Structure

Background The structure of a BST is determined by the order of the data Depending on the order we can get either very balanced or very unbalanced trees. This is not a good way to build a tree A PR Quadtree is a way to handle particular data that can be mapped to a “world”

Quadtrees Quadtrees are a whole family of trees. They are all based on the use of recursive decomposition They can be differentiated by two ways:  The type of data they represent  The principle guiding the decomposition process  The resolution (variable or not)

PR Quadtree Data is stored in leaves only. Internal nodes have four pointers. Pointers are labeled as NW, NE, SE, SW If during insertion a leaf node is found and the coordinates of the leaf node’s data differ from the data that is trying to be insert, then a new internal node is created and both pieces of data are inserted

Node Considerations This is a natural case where internal nodes and leaf nodes are different. A natural choice here would be to use inheritance. However most of the functions would be very different; so polymorphism might not really be all that helpful If you use inheritance about the only common method might be isLeaf() You will then have to cast the node as either an internal or leaf node

Insertion As you build a PR Quadtree, you will need to create both internal and leaf nodes The process is recursive You could put an insert method in the node class. What would happen here is a little different from how you may have done insertion in the past

Node’s handling Insertion You could polymorphically call insertion on a node and it would “know” which insertion to call The internal node would ask the data its coordinates and determine where it goes. In order to do this, the method needs to know some additional information It needs to know the corner of the world and the width of the world.

Leaf Insertion The leaf node insertion would have to do some more work First it would need to check to make sure that the data that is trying to be inserted isn’t already in the tree If not, then it needs to create a new internal node Then ask the new node to insert both the data that is already in the tree and the data that is trying to be inserted