C Point Version 0.9.2 July 2003 By Andrea Kohlhase, The Course Capsules Project (CCaps),CMU Look at our website CCaps for latest news!CCaps C ategorize.

Slides:



Advertisements
Similar presentations
Chapter 7. Binary Search Trees
Advertisements

Introduction to Computer Science 2 Lecture 7: Extended binary trees
Prof. Amr Goneid, AUC1 Analysis & Design of Algorithms (CSCE 321) Prof. Amr Goneid Department of Computer Science, AUC Part R4. Disjoint Sets.
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.
1 Theory I Algorithm Design and Analysis (2 - Trees: traversal and analysis of standard search trees) Prof. Th. Ottmann.
EECS 311: Chapter 8 Notes Chris Riesbeck EECS Northwestern.
Disjoint Sets Given a set {1, 2, …, n} of n elements. Initially each element is in a different set.  {1}, {2}, …, {n} An intermixed sequence of union.
1 By Andrea Kohlhase, The Course Capsules Project (CCaps),CMU Look at our website CCaps for latest news!CCaps C Point Documentation Version (07/??/2003)
Tirgul 10 Rehearsal about Universal Hashing Solving two problems from theoretical exercises: –T2 q. 1 –T3 q. 2.
Union-Find Problem Given a set {1, 2, …, n} of n elements. Initially each element is in a different set. {1}, {2}, …, {n} An intermixed sequence of union.
1 Assignment 2: (Due at 10:30 a.m on Friday of Week 10) Question 1 (Given in Tutorial 5) Question 2 (Given in Tutorial 7) If you do Question 1 only, you.
Heaps Heaps are used to efficiently implement two operations:
Lecture 9 Disjoint Set ADT. Preliminary Definitions A set is a collection of objects. Set A is a subset of set B if all elements of A are in B. Subsets.
Lecture 16: Union and Find for Disjoint Data Sets Shang-Hua Teng.
Algorithm Cost Algorithm Complexity. Algorithm Cost.
Data Structure (III) GagGuy.
Advanced Algorithms Analysis and Design Lecture 8 (Continue Lecture 7…..) Elementry Data Structures By Engr Huma Ayub Vine.
Dictionaries CS 105. L11: Dictionaries Slide 2 Definition The Dictionary Data Structure structure that facilitates searching objects are stored with search.
Ajinkya Nene, Lynbrook CS Club. 04/21/2014. Definition Allows you to figure the worst-case bound for the performance of an algorithm (most useful for.
MATH 224 – Discrete Mathematics
Union-Find Problem Given a set {1, 2, …, n} of n elements. Initially each element is in a different set.  {1}, {2}, …, {n} An intermixed sequence of.
CSE373: Data Structures & Algorithms Lecture 11: Implementing Union-Find Aaron Bauer Winter 2014.
Prof. Amr Goneid, AUC1 CSCE 210 Data Structures and Algorithms Prof. Amr Goneid AUC Part 9. Disjoint Sets.
CMSC 341 Disjoint Sets. 8/3/2007 UMBC CMSC 341 DisjointSets 2 Disjoint Set Definition Suppose we have an application involving N distinct items. We will.
Binary Trees Definition A binary tree is: (i) empty, or (ii) a node whose left and right children are binary trees typedef struct Node Node; struct Node.
MA/CSSE 473 Day 21 AVL Tree Maximum height 2-3 Trees Student questions?
1 C PointGraphs Documentation Version 0.1 (01/2003) By Andrea Kohlhase, The Course Capsules Project (CCaps),CMU Look at our website CCaps for latest news!CCaps.
Union-find Algorithm Presented by Michael Cassarino.
Union Find ADT Data type for disjoint sets: makeSet(x): Given an element x create a singleton set that contains only this element. Return a locator/handle.
Set Representation S 1 ={0, 6, 7, 8}, S 2 ={1, 4, 9}, S 3 ={2, 3, 5} Two operations considered here  Disjoint set union S 1  S 2 ={0,6,7,8,1,4,9}  Find(i):
CSE373: Data Structures & Algorithms Lecture 11: Implementing Union-Find Nicki Dell Spring 2014.
CSE373: Data Structures & Algorithms Lecture 10: Implementing Union-Find Dan Grossman Fall 2013.
Fundamental Data Structures and Algorithms Peter Lee April 24, 2003 Union-Find.
Fundamental Data Structures and Algorithms Margaret Reid-Miller 21 April 2005 Equivalence and Union-Find.
Union & Find Problem 황승원 Fall 2010 CSE, POSTECH 2 2 Union-Find Problem Given a set {1, 2, …, n} of n elements. Initially each element is in a different.
1 Disjoint Set Data Structure. 2 Disjoint Sets What are Disjoint Sets? Tree Representation Basic Operations Parent Array Representation Simple Find and.
ICS 353: Design and Analysis of Algorithms Heaps and the Disjoint Sets Data Structures King Fahd University of Petroleum & Minerals Information & Computer.
1 Today’s Material The dynamic equivalence problem –a.k.a. Disjoint Sets/Union-Find ADT –Covered in Chapter 8 of the textbook.
1 CPSC 320: Intermediate Algorithm Design and Analysis July 16, 2014.
CS 146: Data Structures and Algorithms July 16 Class Meeting Department of Computer Science San Jose State University Summer 2015 Instructor: Ron Mak
Merge Sort Data Structures and Algorithms CS 244 Brent M. Dingle, Ph.D. Department of Mathematics, Statistics, and Computer Science University of Wisconsin.
Union-Find  Application in Kruskal’s Algorithm  Optimizing Union and Find Methods.
CHAPTER 8 THE DISJOINT SET ADT §1 Equivalence Relations 【 Definition 】 A relation R is defined on a set S if for every pair of elements (a, b), a, b 
MST, Topological Sort and Disjoint Sets
WEEK 5 The Disjoint Set Class Ch CE222 Dr. Senem Kumova Metin
Fundamental Data Structures and Algorithms Klaus Sutner April 20, 2004 Equivalence and Union-Find.
CSE 589 Applied Algorithms Spring 1999 Prim’s Algorithm for MST Load Balance Spanning Tree Hamiltonian Path.
1 By Andrea Kohlhase, The Course Capsules Project (CCaps),CMU Look at our website CCaps for latest news!CCaps C Point Documentation Version Alpha.
Data Structures for Disjoint Sets Manolis Koubarakis Data Structures and Programming Techniques 1.
How many edges does a tree of n nodes have? 1.2n-4 2.n(n-1)/2 3.n-1 4.n/2 5.Between n and 2n.
CSCE 210 Data Structures and Algorithms
Applied Algorithmics - week7
COSC160: Data Structures Linked Lists
Ch. 11 Trees 사실을 많이 아는 것 보다는 이론적 틀이 중요하고, 기억력보다는 생각하는 법이 더 중요하다.
An application of trees: Union-find problem
Course Outline Introduction and Algorithm Analysis (Ch. 2)
CMSC 341 Disjoint Sets Based on slides from previous iterations of this course.
CSE373: Data Structures & Algorithms Lecture 11: Implementing Union-Find Linda Shapiro Spring 2016.
CSE 332: Data Structures Disjoint Set Union/Find
ICS 353: Design and Analysis of Algorithms
CSE 373 Data Structures and Algorithms
CSE 332: Data Abstractions Union/Find II
ICS 353: Design and Analysis of Algorithms
CSE373: Data Structures & Algorithms Implementing Union-Find
Fundamental Data Structures and Algorithms
Union-Find Partition Structures
Running Time Analysis Union is clearly a constant time operation.
Set Representation S1={0, 6, 7, 8}, S2={1, 4, 9}, S3={2, 3, 5}
Union-Find Problem Given a set {1, 2, …, n} of n elements.
An application of trees: Union-find problem
Presentation transcript:

C Point Version July 2003 By Andrea Kohlhase, The Course Capsules Project (CCaps),CMU Look at our website CCaps for latest news!CCaps C ategorize Objects to add value C ontent For marking up objects C onvert To other formats C o nn ect To other applications

My test axiom My  axiom This is an inserted symbol  And   and  Infinity This is a character with a special font R RealR TestSymbol Plus Definitions: Text Sections With use of Symbols (defined in the Definitions) Math Text

Theory test2 My test2 axiom My test2 assertion My test2 conclusion

My R axiom For all α, β in R, we have  α * β in R My  claim My next test Andreas Test QMath 2

Annotation Details Forms Theory Example Question Counter Example Answer Rhetorical Question CommentNote ExerciseSolutionHint Assertion Proof Step Remark CodeGraphics Moti- vation Warning Intro- duction No OMDoc DefinitionAxiom Each object on this slide is annotated! QMath 1  

Mein Lieblingstitel Theory for the rest of the world Liste mit Symbolen: Liste1  1. Liste11  2.Liste12  3.Liste13  Liste 2 My ordered list21 My unordered sublist212

Not Uniform list with linked image Uniform 1 Uniform2 Uniform Bonus: Uniform 12

Time bounds Variables –M operations.N elements. Algorithms –Simple forest representation in arrays Worst: find O(N). mixed operations O(MN). Average: tricky –Union by height; Union by size Worst: find O(log N). mixed operations O(M log N). Average: mixed operations O(M) [see text] –Path compression in find Worst: mixed operations: “nearly linear” [analysis forthcoming]

Group tests Groupelement with text T  es  t1 T  e  st2 Test3 This is a nested group (=group in group) These are simple groups

Character entities? This is a character entity ¼. This is another one Ŵ. Ƣ –Symbols(inserted by Insert Symbol):ÐǼ, – SymbolFont: 

Table 1a1B1D 2A2B2C 3A3B 4a

find flattens trees Redirect nodes to point directly to the root Graphics? a d e b f c This is a group  This is not a group, but may be annotated as graphics! In fact: it is with “image only”-property. That means the ovals and arrows are not considered independent objects any more in terms of CPoint. Do this whenever traversing a path from node to root.

find flattens trees Redirect nodes to point directly to the root Graphics? (II) a d e b f c This is a group  This is not a group, but may be annotated as graphics! In fact: it is with “disregard underlying structure”-property. That means the ovals and arrows are not considered independent objects any more in terms of CCaps. This is annotated as graphics! (Disregarding underlying structure) This is annotated as graphics. (Regarding underlying structure)

All the code in Java (annotated as Code) class UnionFind { int[] u; UnionFind(int n) { u = new int[n]; for (int i = 0; i < n; i++) u[i] = -1; } int find(int i) { int j,root; for (j = i; u[j] >= 0; j = u[j]) ; root = j; while (u[i] >= 0) { j = u[i]; u[i] = root; i = j; } return root; } void union(int i,int j) { i = find(i); j = find(j); if (i !=j) { if (u[i] < u[j]) { u[i] += u[j]; u[j] = i; } else { u[j] += u[i]; u[i] = j; } }

Some Proofs First we state the theorem Then comes the first proof step And now the second one This concludes the proof QED My Proofstep for this theorem

My TexPoint Test As LaTex isn’t working on H: (or I can’t find it), it is just an error, but the source of this error in LaTex should be outputted in the OMDoc document

My OLEObjects This chart was inserted as an embedded OLE Object ….

End End Slide Show (with notes)