Line Segment Intersection. Balanced binary search tree Internal nodes: Rightmost leaf in its left subtree Status Structure T.

Slides:



Advertisements
Similar presentations
Two Segments Intersect?
Advertisements

Geometry Introduction
Polygon Triangulation
Computational Geometry
Info 3.3. Chapter 3.3 Recursive Data Structures Part 2 : Binary Trees.
2/3/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Triangulations and Guarding Art Galleries II Carola Wenk.
9/12/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Triangulations and Guarding Art Galleries II Carola Wenk.
Overlay of Two Subdivisions
9/5/06CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2006 Plane Sweep Algorithms and Segment Intersection Carola Wenk.
CS138A Line Segment Intersection Peter Schröder.
CS2420: Lecture 24 Vladimir Kulyukin Computer Science Department Utah State University.
1 Binary Search Trees Implementing Balancing Operations –AVL Trees –Red/Black Trees Reading:
B-Tree B-Tree is an m-way search tree with the following properties:
Rooted Trees. More definitions parent of d child of c sibling of d ancestor of d descendants of g leaf internal vertex subtree root.
Line Segment Intersection Computational Geometry, WS 2006/07 Lecture 3 – Part II Prof. Dr. Thomas Ottmann Algorithmen & Datenstrukturen, Institut für Informatik.
1 Section 9.2 Tree Applications. 2 Binary Search Trees Goal is implementation of an efficient searching algorithm Binary Search Tree: –binary tree in.
B + -Trees (Part 2) COMP171. Slide 2 Review: B+ Tree of order M and of leaf size L n The root is either a leaf or 2 to M children n Each (internal) node.
Lecture 2 Line Segment Intersection Computational Geometry Prof.Dr.Th.Ottmann 1 Line Segment Intersection Motivation: Computing the overlay of several.
Orthogonal Line Segment Intersection Given N horizontal and N vertical line segments, find all intersections. All x and y coordinates are distinct.
Trees, Binary Search Trees, Recursion, Project 2 Bryce Boe 2013/08/01 CS24, Summer 2013 C.
UNC Chapel Hill M. C. Lin Line Segment Intersection Chapter 2 of the Textbook Driving Applications –Map overlap problems –3D Polyhedral Morphing.
Quiz 2 [answer in the back] 2. Two line segments: S1: (1,2) to (5,6) S2: (3,5) to (7,3) Compute the intersection 3. Explain the complexity for line segment.
1 Red-Black Trees By Mary Hudachek-Buswell Red Black Tree Properties Rotate Red Black Trees Insertion Red Black Trees.
Trees A tree is a set of nodes which are connected by branches to other nodes in a 'tree-like' structure. There is a special node called the root from.
2/19/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Voronoi Diagrams Carola Wenk Based on: Computational Geometry:
Billy Timlen Mentor: Imran Saleemi.  Goal: Have an optimal matching  Given: List of key-points in each image/frame, Matrix of weights between nodes.
Computer Science 112 Fundamentals of Programming II Introduction to Trees.
Binary Trees In computer science, a binary tree is a tree data structure in which each node has at most two children, which are referred to as the left.
Data Structure II. Outline Heap Binary Search Tree Hash Table Binary Indexed Tree Segment Tree.
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.
UNC Chapel Hill M. C. Lin Computing Voronoi Diagram For each site p i, compute the common inter- section of the half-planes h(p i, p j ) for i  j, using.
CSE 3358 NOTE SET 13 Data Structures and Algorithms.
AVL TREES By Asami Enomoto CS 146 AVL Tree is… named after Adelson-Velskii and Landis the first dynamically balanced trees to be propose Binary search.
Dynamic Dictionaries Primary Operations:  get(key) => search  put(key, element) => insert  remove(key) => delete Additional operations:  ascend()
More Binary Search Trees, Project 2 Bryce Boe 2013/08/06 CS24, Summer 2013 C.
Hello Everyone!!! 1. Tree And Graphs 2 Features of Trees  Tree Nodes Each node have 0 or more children A node have must one parent  Binary tree Tree.
9/8/10CS 6463: AT Computational Geometry1 CS 6463: AT Computational Geometry Fall 2010 Triangulations and Guarding Art Galleries Carola Wenk.
1/20/15CMPS 3130/6130 Computational Geometry1 CMPS 3130/6130 Computational Geometry Spring 2015 Plane Sweep Algorithms I Carola Wenk.
CPS120: Introduction to Computer Science Nell Dale John Lewis Abstract Data Types.
AVL Tree: Balanced Binary Search Tree 9.
3.1 Height-Balanced Trees 3.2 Weight-Balanced Trees
Chapter 47 Red Black Trees
Chapter 48 Red Black Trees
Recursive Objects (Part 4)
Binary search tree. Removing a node
AVL DEFINITION An AVL tree is a binary search tree in which the balance factor of every node, which is defined as the difference between the heights of.
Introduction Applications Balance Factor Rotations Deletion Example
Tree.
Objective: Understand Concepts related to trees.
Section 8.1 Trees.
Dynamic Dictionaries Primary Operations: Additional operations:
CMPS 3130/6130 Computational Geometry Spring 2017
Segment tree and Interval Tree
BTrees.
Computational Geometry Capter:1-2.1
Chapter 43 Red Black Trees
CS223 Advanced Data Structures and Algorithms
Binary Tree Traversals
AVL Search Tree put(9)
Lecture No.20 Data Structures Dr. Sohail Aslam
Lecture 36 Section 12.2 Mon, Apr 23, 2007
COMP171 B+-Trees (Part 2).
Binary Search Trees Chapter 9 2/22/2019 B.Ramamurthy.
CS223 Advanced Data Structures and Algorithms
Binary Search Trees Chapter 9 2/24/2019 B.Ramamurthy.
Definition Applications Implementations Heap Comparison
m-Way Search Trees A m-way Search tree of degree ‘m’ can have
Chapter 20: Binary Trees.
COMP171 B+-Trees (Part 2).
Chapter 11 Trees © 2011 Pearson Addison-Wesley. All rights reserved.
Presentation transcript:

Line Segment Intersection

Balanced binary search tree Internal nodes: Rightmost leaf in its left subtree Status Structure T

 p corresponds to lower endpt

L={S5,S4} C={S1,S3} U={S2} Updating T

a: U(a) = {s1}, L(a)=C(a)=   T=[s1] s’=s1,sl= , no-op s”=s1,sr= , no-op s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[b,c,d,e,f] Case 1-1

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[c,d,e,f] b: U(b) = {s2}, L(b)=C(b)=   T=[s1,s2] s’=s2,sl=s1,FindNewEvent(s1,s2,b) s”=s2,sr= ,no-op Case 1-2

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[d,e,f]  [x,d,e,f] c: U(c) = {s3}, L(c)=C(c)=   T=[s1,s3,s2] s’=s3,sl=s1,FindNewEvent (s1,s3,c) s”=s3,sr=s2,FindNewEvent(s2,s3,c)  x x Case 1-3

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[d,e,f] x x: U(x) = L(x)=  C(x)={s2,s3}  report intersection {s2,s3} T:[s1,s3,s2]  [s1]  [s1,s2,s3] s’=s2,sl=s1,FindNewEvent (s1,s2,x) s”=s3,sr= ,no-op Case 1-4

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[e,f] x d: U(d) = C(d) =  L(d) ={s1} T:[s1,s2,s3]  [s2,s3] sr=s2,sl= ,no-op Case 1-5

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[f] x e: U(e) = C(e) =  L(e) ={s2} T:[s2,s3]  [s3] sr=s3,sl= ,no-op Case 1-6

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[ ] x f: U(f) = C(f) =  L(f) ={s3} T:[s3]  [], the end… Case 1-7

a: U(a) = {s1}, L(a)=C(a)=   T=[s1] s’=s1,sl= , no-op s”=s1,sr= , no-op s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[b,c,d,e,f] Case 2-1

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[c,d,e,f] Case 2-2 b: U(b) = {s2}, L(b)=C(b)=   T=[s1,s2] s’=s2,sl=s1,FindNewEvent(s1,s2,p) s”=s2,sr=  no-op

s1s1 s2s2 s3s3 a b c d e f Event Queue Q=[d,e,f] Case 2-3 c: U(c) = {s3}, L(c)=  C(c)=  s2   report intersection [s2,s3]  T=[s1,s3,s2] s’=s3,sl=s1,FindNewEvent (s1,s3,p)  x  d s”=s3,sr=s2,FindNewEvent(s2,s3,p)

s1s1 s2s2 s3s3 a b c,y d e f Event Queue Q=[e,f] Case 2-4 d: U(d) = , L(d)={s1} C(d)={s3}  report intersection: [s1,s3]  T=[s1,s3,s2]  [s2]  [s3,s2] s’=s3,sl= ,no-op s”=s3,sr=s2,FindNewEvent(s3,s2,d)  above sweep line

s1s1 s2s2 s3s3 a b c,y d e f Event Queue Q=[f] Case 2-5 e: U(e) = , L(e)={s2}, C(e)=   T=[s3,s2]  [s3] sl=s3,sr= ,no-op

s1s1 s2s2 s3s3 a b c,y d e f Event Queue Q=[ ] Case 2-6 f: U(f) = , L(f)={s3}, C(f)=   T=[s3]  [ ].. The end