Representing Structure and Behavior with Trees

Slides:



Advertisements
Similar presentations
© 2011 Delmar, Cengage Learning Chapter 1 Getting Started with Dreamweaver.
Advertisements

Lecture - 1 on Data Structures. Prepared by, Jesmin Akhter, Lecturer, IIT,JU Data Type and Data Structure Data type Set of possible values for variables.
1 of 5 This document is for informational purposes only. MICROSOFT MAKES NO WARRANTIES, EXPRESS OR IMPLIED, IN THIS DOCUMENT. © 2007 Microsoft Corporation.
Senior Project – I.D. Math & Computer Science jsMath Equation Editor Dana Cartwright Advisors – Prof. Cervone & Prof. Striegnitz Editor Design -
The Composite Pattern.. Composite Pattern Intent –Compose objects into tree structures to represent part-whole hierarchies. –Composite lets clients treat.
Microsoft Office Illustrated Inserting Illustrations, Objects, and Media Clips.
THE BASICS OF THE WEB Davison Web Design. Introduction to the Web Main Ideas The Internet is a worldwide network of hardware. The World Wide Web is part.
The Internet & The World Wide Web Notes
UML Class Diagrams: Basic Concepts. Objects –The purpose of class modeling is to describe objects. –An object is a concept, abstraction or thing that.
WEB DESIGNING Prof. Jesse A. Role Ph. D TM UEAB 2010.
C o n f i d e n t i a l Developed By Nitendra NextHome Subject Name: Data Structure Using C Title: Overview of Data Structure.
Unit 2 — Building Web Part B) Designing the Web. Phase 1: Planning a Web Site Like an architect designing a building, adequately planning your Web site.
Trees & Graphs Nell Dale & John Lewis (adaptation by Michael Goldwasser and Erin Chambers)
Movie Maker in the High School Classroom Professional Development Workshop September 1, 2009 Facilitator: Heidi Camp Swartz Creek High School.
Problem Solving with Data Structures using Java: A Multimedia Approach Chapter 10: Generalizing Lists and Trees.
1 Web Basics Section 1.1 Compare the Internet and the Web Compare Web sites and Web pages Identify Web browser components Describe types of Web sites Section.
Advanced Level Course. Site Extras Site Extras consist of four categories: Stationeries Site Trash Designs Components.
Trees. Introduction to Trees Trees are very common in computer science They come in different forms They are used as data representation in many applications.
Spring 2010CS 2251 Trees Chapter 6. Spring 2010CS 2252 Chapter Objectives Learn to use a tree to represent a hierarchical organization of information.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 - Domain Classes.
Systems Analysis and Design in a Changing World, 6th Edition 1 Chapter 4 Domain Classes.
Data Structures TREES.
CSCI-383 Object-Oriented Programming & Design Lecture 10.
Circular linked list A circular linked list is a linear linked list accept that last element points to the first element.
BINARY TREES Objectives Define trees as data structures Define the terms associated with trees Discuss tree traversal algorithms Discuss a binary.
Data Structure and Algorithms
PowerPoint Vocabulary Tabs 1. Backgrounds: Backgrounds are used in presentations to create a more interesting eye-pleasing look. Backgrounds may include.
Lecture 9:FXML and Useful Java Collections Michael Hsu CSULA.
introductionwhyexamples What is a Web site? A web site is: a presentation tool; a way to communicate; a learning tool; a teaching tool; a marketing important.
Object-oriented programming (OOP) is a programming paradigm using "objects" – data structures consisting of data fields and methods together with their.
Lesson 4 Basic Text Formatting. Objectives ● I ● In this tutorial we will: ● Introduce Wiki Syntax ● Learn how to Bold and Italicise text, and add Headings.
Getting Started with Dreamweaver
How to make things a little more interesting!!
Slide design: Dr. Mark L. Hornick
Windows 7 and file management
Computer Fundamentals 1
Microsoft PowerPoint This is the introduction to PowerPoint.
Chapter 4 Linked Structures.
CUS POWERPOINT PRESENTATION
Lecture 1 (UNIT -4) TREE SUNIL KUMAR CIT-UPES.
Course Outcomes of Object Oriented Modeling Design (17630,C604)
Practical Office 2007 Chapter 10
Object-Oriented Analysis and Design
Introduction to presentations ms PowerPoint
Collaborations and Hierarchies
CONTENT MANAGEMENT SYSTEM CSIR-NISCAIR, New Delhi
Abstract descriptions of systems whose requirements are being analysed
Trees.
Microsoft PowerPoint This is the introduction to PowerPoint.
Getting Started with Dreamweaver
structures and their relationships." - Linus Torvalds
CMSC 341 Lecture 10 B-Trees Based on slides from Dr. Katherine Gibson.
UML Class Diagrams: Basic Concepts
Microsoft PowerPoint This is the introduction to PowerPoint.
B- Trees D. Frey with apologies to Tom Anastasio
Getting Started with Dreamweaver
Building ASP.NET Applications
Cs212: Data Structures Computer Science Department Lecture 6: Stacks.
Functions.
Trees.
Introduction to Data Structures
Introduction to Data Structure
Basic OOP Concepts and Terms
Data Structures & Algorithms
CS2013 Lecture 7 John Hurley Cal State LA.
Important Problem Types and Fundamental Data Structures
Microsoft PowerPoint This is the introduction to PowerPoint.
Data Structures Using C++ 2E
structures and their relationships." - Linus Torvalds
Lecture 3 – Data collection List ADT
Presentation transcript:

Representing Structure and Behavior with Trees CS1316: Representing Structure and Behavior

Story What trees are good for. What we were just doing with LLNode What linked lists are good for. Using linked lists to represent structure and behavior What trees are good for. Using trees to represent structure and behavior Examples Equations Matching Unification

Abstracting LLNode abstract LLNode Knows next Knows how to do all basic list operations

CollectableNode Knows just knows the part that specializes LLNode for collectable (sound-returning) nodes.

DrawableNode Just specializes LLNode to represent things that can draw with a turtle and draw down their linked list with a turtle (drawOn).

LLNode: The abstract definition of what a linked list node is Given LLNode, we can make anything we want into a linked list. Want a linked list of students? Subclass LLNode into StudentNode StudentNodes know names and ID numbers, and know how to access and return these. The linked list part is inherited from LLNode. Every StudentNode knows next and knows how to getNext, add, etc.

Why do people use linked lists? Whenever you want dynamic size to the list, You may want the ordering to represent something, You want insertion and deletion to be cheap and easy, You are willing to make finding a particular item slower.

Examples of Linked Lists Order of layers in Visio or PowerPoint Notes in a Phrase in JMusic Video segments in non-linear video editing. Items in a toolbar. Slides in a PowerPoint presentation.

But what are trees good for? Trees represent hierarchical structure. When just representing ordering (linearity) isn’t enough. Trees can store operations (behavior), as well as data. Linked lists can, too, but not as useful.

Examples of Trees Representing how parts of music assemble to form a whole. Representing the elements of a scene. Scene graph Representing the inheritance relationships among classes. Class hierarchy Files and directories on your hard disk. Elements in an HTML page. Organization chart Political affiliations

Example Tree: Equation It’s fairly easy to turn an equation into a tree. If you see an operation, make a branch. Otherwise, make a node. The structure here represents order of operation. Evaluating this tree is like collecting() the sounds, but collection involves computation (behavior) at the branches. 3 + 4 * 5 + 3 * 4 5

Example Tree: Taxonomies (Keeping track of meaning) Let’s say that you want to compare prices at various websites for the same item. At one site, they call it the “retail price” At another, they call it the “customer’s cost” How do you track that these are similar meanings? It’s the same as knowing that a MoveBranch is a kind of Branch is a kind of DrawableNode!

Tree of Meanings Here, the arrows mean the same thing as in a class hierarchy. The thing below is a specialization of the thing above. Artificial Intelligence (AI) and Semantic Web researchers really do represent taxonomies in just this way. Price Retail price Wholesale price Customer cost Business-to-business price Customer price

Algorithm for matching Traverse the tree to find phrase1. Traverse the tree to find phrase2. Do both have a common ancestor (parent)? That’s the meaning in common! If not, need to extend the taxonomy.

Example tree: Unification My cat ate a fat worm. Sentence Diagrams are trees. Arrows don’t mean the same things here. Some arrows are saying instance-of a category (like “noun”) Other arrows are saying has-pieces-within (like links from “subject” and “object”) ate verb subject object noun article noun cat adjective adjective a worm My fat

How do we search a collection of sentence diagrams? Imagine: You’re an expert with the National Security Agency. You have megabytes of captured terrorist messages. Using specialized Natural Language Understanding (NLU) technology, you have trees of all this text. Now what do you do with it?

Compare trees attack We can create a tree describing the kind of sentence that we want to find. We leave variables that can be bound in the process of the query. Matching complex trees like this is sometimes called unification. Not exactly the same word? How do we determine if it’s close enough? See previous slides… verb subject object noun noun <suspect> <location in United States>

Trees in User Interfaces Any user interface is actually composed of a tree! Windows hold panes hold buttons and text areas. Next lecture… window pane pane button text area button button