Unions.

Slides:



Advertisements
Similar presentations
1 Functional Programming Lecture 8 - Binary Search Trees.
Advertisements

1 Union-find. 2 Maintain a collection of disjoint sets under the following two operations S 3 = Union(S 1,S 2 ) Find(x) : returns the set containing x.
Original Tree:
What is the next line of the proof? a). Let G be a graph with k vertices. b). Assume the theorem holds for all graphs with k+1 vertices. c). Let G be a.
Is the following graph Hamiltonian- connected from vertex v? a). Yes b). No c). I have absolutely no idea v.
B + -Trees (Part 2) Lecture 21 COMP171 Fall 2006.
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.
Percents. What is percent? Percent (or per cent) means “per 100” or “out of 100” For example: If you answered 90 out of 100 questions correctly on a test.
Digital Electronics Data Structures LISP
Database Management 9. course. Execution of queries.
Data Structure & Algorithm II.  Delete-min  Building a heap in O(n) time  Heap Sort.
Compound Inequalities
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
Absolute Value! Sept. 10 and 11. Bell Quiz! Remove everything from desk except for pencil and calculator.
CSE 326: Data Structures Lecture #9 Big, Bad B-Trees Steve Wolfman Winter Quarter 2000.
General Discussion of “Properties” The Pumping Lemma Membership, Emptiness, Etc.
VERB TO BE. PART 1 VERB TO BE 1. The weather ___ nice today. is am are.
Red-Black Trees v z Red-Black Trees Red-Black Trees
Software Correctness Interacting programs SWEN T2.
B-Trees B-Trees.
Binary Search Trees < > =
Primary Longman Elect 2A Chapter 6 Meet my family Do you have …?
Binary search tree. Removing a node
Margin of Error: We’re Only Human…
Binary Search Trees.
Binary Search Tree (BST)
Multiway search trees and the (2,4)-tree
Red-Black Trees v z Red-Black Trees 1 Red-Black Trees
Binary Search Tree Chapter 10.
Insert in amortized cost O(1), Merge in O(lgn) DeleteMax in O(lgn)
Chapter Trees and B-Trees
Chapter Trees and B-Trees
Binary Trees, Binary Search Trees
What is poverty?.
Red-Black Trees v z /20/2018 7:59 AM Red-Black Trees
Red-Black Trees v z Red-Black Trees Red-Black Trees
B+ Trees What are B+ Trees used for What is a B Tree What is a B+ Tree
Proportions TeacherTwins©2014.
Solve Absolute Value Inequalities
Molarity (cont.).
Copy Assignment CSCE 121 J. Michael Moore.
Priority Queues (Chapter 6.6):
Random inserting into a B+ Tree
Binary Search Trees.
ConcepTest 27.1 Junction Rule
Red-Black Trees v z /17/2019 4:20 PM Red-Black Trees
CS6045: Advanced Algorithms
How to determine whether a given set of vectors
B-TREE ________________________________________________________
Binary Search Trees < > =
COMP171 B+-Trees (Part 2).
Justify your reasoning.
Non-Linear Structures
Data Structures Lecture 29 Sohail Aslam.
Binary Search Trees < > =
4.3 Properties of inequalities Date: 11/13/18
2-3 Trees Extended tree. Tree in which all empty subtrees are replaced by new nodes that are called external nodes. Original nodes are called internal.
COMP171 B+-Trees (Part 2).
Priority Queues (Chapter 6):
Heaps By JJ Shepherd.
B-Trees.
Warm-up: Why is the following not a piecewise-defined function?
Red Black Trees.
B-Trees.
Heaps & Multi-way Search Trees
Copy Assignment CSCE 121.
Types of Errors And Error Analysis.
Damage Scoring Flowchart
The Civil War The Beginning.
Heaps Section 6.4, Pg. 309 (Section 9.1).
Presentation transcript:

Unions

Which of the following are equivalence relations? Equality Equivalent +/- error “has the same absolute value” The empty relation (nothing equivalent)

Which of the following are equivalence relations? Equality (yes) Equivalent +/- error (no) “has the same absolute value” (yes) The empty relation (nothing equivalent) (no)

Unions by size create on set containing numbers between 1 and 10 What does find 1 return? 1 2 3 4 5 6 7 8 9 10

Unions by size How will the tree look after Join(2, 4)? 1 2 3 4 5 6 7 8 9 10

Unions by size How will the tree look after Join(2, 4)? What about after Join(2, 6)? 2 1 3 4 5 6 7 8 9 10

Unions by size How will the tree look after Join(2, 6)? What about after Join(2, 8)? 2 1 3 4 5 6 7 8 9 10

Unions by size Why aren’t find and union O(1)? 2 1 3 4 5 6 7 8 9 10

Unions by size What happens after Union(3, 2)? 3 2 1 4 5 6 7 8 9 10

Unions by size What happens after Union(3, 2)? If we made all 2’s children point to 3, what would be the cost? 3 2 1 4 5 6 7 8 9 10

B-Trees Is the following a 3-5 B-Tree? If not, what would the correct tree be? (Assume leaves can have at most 3 keys) 7 8 9 11

B-Trees Not a 3-5 B-Tree Correction 7 8 9 11 8 9 11

B-Trees Is the following a 3-5 B-Tree? If not, what would be the correct tree? (Assume leaves can have at most 3 keys) 7 10 4 5 11 12 8 9

B-Trees What happens if we delete 11? 7 10 4 5 11 12 8 9

B-Trees What happens if we delete 11? 7 10 4 5 12 8 9

B-Trees What happens if we delete 11? 7 4 5 8 9 12