CSE 373 Optional Section Disjoint Sets & Homework 4 February 13, 2014 Nicholas Shahan & A. Conrad Nied.

Slides:



Advertisements
Similar presentations
IMAGE RESIZING & SEAMCARVING CS16: Introduction to Algorithms & Data Structures Thursday, January 23, 14 1.
Advertisements

ArrayLists The lazy mans array. Whats the matter here? int[] list = new int[10]; list[0] = 5; list[2] = hey; list[3] = 15; list[4] = 23;
Use Tables for Layout Control Day 7. You will learn to: Understand Tables Create a Simple Table Modify Your Tables Appearance Create Page Layouts with.
4.3 Matrix Approach to Solving Linear Systems 1 Linear systems were solved using substitution and elimination in the two previous section. This section.
CSE 373 Optional Section Union Find, Homework & A. Conrad Nied.
1 After completing this lesson, you will be able to: Add a header and footer to a worksheet. Change margins and center a worksheet. Change the orientation.
CREATING A MULTIPLE PAGE REPORT Presented by: Dr. Ennis-Cole.
Page margin margin for header and footer. page size page orientation.
® Microsoft Office 2010 Word Tutorial 3 Creating a Multiple-Page Report.
COMPREHENSIVE ICT Document Preparation System Mr.S.Sajiharan Computer Unit Faculty of Arts and Culture South Eastern University of Srilanka.
Study Guide Commercial Photography Technology
 Next - Previous  Horizontal Bar  Vertical Menu.
Excel Lesson 3 Organizing the Worksheet
Excel: Printing and Headers & Footers Computer Information Technology Section 6-11 Some text and examples used with permission from:
Kevyn Bollinger Eric Gonsalves Ben Henry James Marsland.
©Brooks/Cole, 2003 Chapter 12 Abstract Data Type.
ACCESS – CHAPTER 4 ZNANATEJ PANGA October 27, 2014.
CSE373 Optional Section Java Collections 11/12/2013 Luyi Lu.
Two-Way Tables & Stepped Tables
1 Excel Lesson 3 Organizing the Worksheet Microsoft Office 2010 Introductory Pasewark & Pasewark.
Matrices Write and Augmented Matrix of a system of Linear Equations Write the system from the augmented matrix Solve Systems of Linear Equations using.
Word Tutorial 3 Creating a Multiple-Page Report
Solving Systems of Equations and Inequalities
Solving Systems of Equations and Inequalities Section 3.1A-B Two variable linear equations Section 3.1C Matrices Resolution of linear systems Section 3.1D.
1 Essential Worksheet Operations Applications of Spreadsheets.
Warm Up 1.) Find the area of the hexagon.
Microsoft Expression Web-Illustrated Unit I: Working with Tables.
 Definition  Components  Advantages  Limitations Contents  Introduction Introduction  Inserting a Table Inserting a Table  Drawing a Table Drawing.
Data structures Abstract data types Java classes for Data structures and ADTs.
FIRST COURSE Word Tutorial 3 Creating a Multiple-Page Report.
Python Arrays. An array is a variable that stores a collection of things, like a list. For example a list of peoples names. We can access the different.
Excel Vocabulary Beth McKelvey. columns Vertical section of worksheet.
Lookup Function (Think of a Book Index).  Need to fill based on what is in the these fields Array table.
Excel Lesson 1 Microsoft Excel Basics
Graphs A graphs is an abstract representation of a set of objects, called vertices or nodes, where some pairs of the objects are connected by links, called.
Key Applications Module Lesson 14 — Working with Tables Computer Literacy BASICS.
Chapter 6.1 POLYGONS.  Draw a picture of a polygon on each of your post-it notes.  Try to draw two different types of polygons (be creative).  Post.
Punch! Pro Platinum Home Design Draw Interior Walls to Create Rooms.
Chapter 15: Spreadsheet and Worksheet Basics – Lesson 92 © 2010, 2006 South-Western, Cengage Learning.
Web111a_chapt04.ppt HTM: Section 4 Tables Table Types Text table elements Easy to use Use fixed-font text (font family monospace) Andale Mono Courier Monaco.
Choose Sprite. Add collision event for object and add score action. Set your score to plus 100 and check relative.
9.3 Similar Right Triangles. Do Now: Draw the altitude and describe what it is.
Sections 2.4 and 2.5 Matrix Operations
CMPT 120 Topic:  Case Study.
University of Central Florida COP 3330 Object Oriented Programming
CS 367 – Introduction to Data Structures
3.5 Graphs in Three Dimensions
HSU Best Practices in OBI Design
Tables:.
Warm Up Use scalar multiplication to evaluate the following:
Adding and Subtracting Polynomials – Part 2
Iterative Deletion Routing Algorithm
Lab 07 – 3D Maze.
Optimal Non-Manhattan Bubble Sort Channel Router
Early Computation Methods
Click to edit title TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing.
EVENT TITLE Time, Date Location
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
EVENT TITLE Time, Date Location
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
Early Computation Methods
Timing with Optimization
TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing arrow to the right on.
Click to edit title TO ADD NEW SLIDE LAYOUTS: Make sure you have the ‘Home’ tab selected at the top of the PowerPoint screen and click the down facing.
Graphing Horizontal and
Section 4.5 The Slope of a Line Goal: Find the slope of a line.
“Direct vs. Indirect Control”
Key Applications Module Lesson 14 — Working with Tables
Presentation transcript:

CSE 373 Optional Section Disjoint Sets & Homework 4 February 13, 2014 Nicholas Shahan & A. Conrad Nied

Agenda Disjoint Sets Review Homework 4 Examples

Disjoint Sets Review OUTBREAK trailer Interactive Example

HW4: Representation? What data structures do we want? Java Collections HashMap, HashSet, Arrays, ArrayList, etc. – Examples: Two arrays, for vertical and horizontal walls A Class for maze walls, stored in a HashSet

HW4: What Numbers Matter? How many rooms are in the maze? Height or Number of Rows Width or Number of Columns How many interior walls? How many exterior walls?

HW4: By The Numbers For a maze with 4 rows and 5 columns: 20 total rooms 49 walls 31 interior walls – 16 vertical interior walls (4 x 4) – 15 horizontal interior walls (3 x 5)

HW4: By The Numbers For a maze with 3 rows and 7 columns: 21 total rooms 52 walls 32 interior walls – 18 vertical interior walls (3 x 6) – 14 horizontal interior walls (2 x 7)

HW4: Consistent Identification One Example: Each room is responsible for knowing its set and its walls left of and below it.

HW4: Example Maze height = 3, width = 4

HW4: Example Maze Number the rooms

HW4: Example Maze After uniting all of the nodes, the Disjoint Sets array looks like this:

HW4: Example Maze The walls to the left of each room are valued as such (1 means that the wall is in the maze)

HW4: Example Maze Likewise, for the horizontal walls below each room:

HW4: Example Maze All together, the numbers for the rooms and the walls look like this:

HW4: Don’t Create Cycles Every time you remove an interior wall it is possible that you created a cycle:

HW4: Example Maze With 3 arrays that look like this:

HW4: MazeBuilder Find wall to remove – Find at random, rooms, walls, and/or neighbors – Make sure you want to remove it Its neighbors are disjoint but adjacent Its not exterior Check if you should continue removing walls “Until all are one…”

HW4: MazeBuilder To print your mazes: Make the top row of walls For each row – Make a row of rooms and vertical walls – Make a row of horizontal walls below this row of rooms Make the bottom row of walls Make sure that you have an opening at the entrance and exit

HW4: Locations Checking for adjacency where w is the width and i is the index of your room. Make sure to not modify or jump over exterior walls.

HW4: MazeSolver The solution is