Tree - in “math speak” An ________ graph is a set of vertices/nodes and a set of edges, each edge connects two vertices. Any undirected graph in which.

Slides:



Advertisements
Similar presentations
Trees Chapter 11.
Advertisements

Chapter 10: Trees. Definition A tree is a connected undirected acyclic (with no cycle) simple graph A collection of trees is called forest.
©Brooks/Cole, 2003 Chapter 12 Abstract Data Type.
CMPS 2433 Discrete Structures Chapter 5 - Trees R. HALVERSON – MIDWESTERN STATE UNIVERSITY.
1 Chapter 10 Trees. Tree Definition 1. A tree is a connected undirected graph with no simple circuits. Theorem 1. An undirected graph is a tree if and.
Data Structures and Algorithms1 Trees The definitions for this presentation are from from: Corman, et. al., Introduction to Algorithms (MIT Press), Chapter.
1 Section 9.1 Introduction to Trees. 2 Tree terminology Tree: a connected, undirected graph that contains no simple circuits –must be a simple graph:
Discrete Mathematics Transparency No. 8-1 Chapter 8 Trees.
1 Spanning Trees Lecture 20 CS2110 – Spring
CS2420: Lecture 13 Vladimir Kulyukin Computer Science Department Utah State University.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
CS 206 Introduction to Computer Science II 09 / 22 / 2008 Instructor: Michael Eckmann.
A tree is a simple graph satisfying: if v and w are vertices and there is a path from v to w, it is a unique simple path. a b c a b c.
Rooted Trees. More definitions parent of d child of c sibling of d ancestor of d descendants of g leaf internal vertex subtree root.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Trees.
Important Problem Types and Fundamental Data Structures
Discrete Mathematics Lecture 9 Alexander Bukharovich New York University.
KNURE, Software department, Ph , N.V. Bilous Faculty of computer sciences Software department, KNURE The trees.
Graph Algorithms Using Depth First Search Prepared by John Reif, Ph.D. Distinguished Professor of Computer Science Duke University Analysis of Algorithms.
May 5, 2015Applied Discrete Mathematics Week 13: Boolean Algebra 1 Dijkstra’s Algorithm procedure Dijkstra(G: weighted connected simple graph with vertices.
Advanced Algorithms Analysis and Design Lecture 8 (Continue Lecture 7…..) Elementry Data Structures By Engr Huma Ayub Vine.
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.
Lecture 13 Graphs. Introduction to Graphs Examples of Graphs – Airline Route Map What is the fastest way to get from Pittsburgh to St Louis? What is the.
CS261 Data Structures Trees Introduction and Applications.
Introduction Of Tree. Introduction A tree is a non-linear data structure in which items are arranged in sequence. It is used to represent hierarchical.
Section 10.1 Introduction to Trees These class notes are based on material from our textbook, Discrete Mathematics and Its Applications, 6 th ed., by Kenneth.
May 1, 2002Applied Discrete Mathematics Week 13: Graphs and Trees 1News CSEMS Scholarships for CS and Math students (US citizens only) $3,125 per year.
1 Section 1.4 Graphs and Trees A graph is set of objects called vertices or nodes where some pairs of objects may be connected by edges. (A directed graph.
Week 11 - Wednesday.  What did we talk about last time?  Graphs  Euler paths and tours.
Tree A connected graph that contains no simple circuits is called a tree. Because a tree cannot have a simple circuit, a tree cannot contain multiple.
Lecture 17 Trees CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
CSCI 115 Chapter 7 Trees. CSCI 115 §7.1 Trees §7.1 – Trees TREE –Let T be a relation on a set A. T is a tree if there exists a vertex v 0 in A s.t. there.
Binary Trees, Binary Search Trees RIZWAN REHMAN CENTRE FOR COMPUTER STUDIES DIBRUGARH UNIVERSITY.
Module #19: Graph Theory: part II Rosen 5 th ed., chs. 8-9.
Discrete Structures Lecture 12: Trees Ji Yanyan United International College Thanks to Professor Michael Hvidsten.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
5.5.3 Rooted tree and binary tree  Definition 25: A directed graph is a directed tree if the graph is a tree in the underlying undirected graph.  Definition.
5.5.2 M inimum spanning trees  Definition 24: A minimum spanning tree in a connected weighted graph is a spanning tree that has the smallest possible.
Trees : Part 1 Section 4.1 (1) Theory and Terminology (2) Preorder, Postorder and Levelorder Traversals.
Trees By P.Naga Srinivasu M.tech,(MBA). Basic Tree Concepts A tree consists of finite set of elements, called nodes, and a finite set of directed lines.
1 Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Trees.
Graph theory and networks. Basic definitions  A graph consists of points called vertices (or nodes) and lines called edges (or arcs). Each edge joins.
Chapter 10: Trees A tree is a connected simple undirected graph with no simple circuits. Properties: There is a unique simple path between any 2 of its.
Data Structures Lakshmish Ramaswamy. Tree Hierarchical data structure Several real-world systems have hierarchical concepts –Physical and biological systems.
CHAPTER 11 TREES INTRODUCTION TO TREES ► A tree is a connected undirected graph with no simple circuit. ► An undirected graph is a tree if and only.
1 Trees What is a Tree? Tree terminology Why trees? What is a general tree? Implementing trees Binary trees Binary tree implementation Application of Binary.
Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 9 Trees.
Graph Concepts Elif Tosun 252a-aa (All graphics created by using demo/graphwin/gw*)
Chapter 6 – Trees. Notice that in a tree, there is exactly one path from the root to each node.
1 Trees : Part 1 Reading: Section 4.1 Theory and Terminology Preorder, Postorder and Levelorder Traversals.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Leda Demos By: Kelley Louie Credits: definitions from Algorithms Lectures and Discrete Mathematics with Algorithms by Albertson and Hutchinson graphics.
Code: BCA302 Data Structures with C Prof. (Dr.) Monalisa Banerjee By.
Section10.1: Introduction to Trees
Graph Search Applications, Minimum Spanning Tree
Applied Discrete Mathematics Week 15: Trees
Proof technique (pigeonhole principle)
Graph Graphs and graph theory can be used to model:
Discrete Mathematicsq
Trees.
Source Code for Data Structures and Algorithm Analysis in C (Second Edition) – by Weiss
Introduction to Trees Section 11.1.
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Trees Slides are adopted from “Discrete.
Lecture 36 Section 12.2 Mon, Apr 23, 2007
A Introduction to Computing II Lecture 13: Trees
Trees 11.1 Introduction to Trees Dr. Halimah Alshehri.
And the Final Subject is…
Important Problem Types and Fundamental Data Structures
Heaps Chapter 6 Section 6.9.
Presentation transcript:

Tree - in “math speak” An ________ graph is a set of vertices/nodes and a set of edges, each edge connects two vertices. Any undirected graph in which every two vertices are connected by exactly one path (sequence of edges & associated vertices) is a ______.

Tree - more properties A tree is a minimally connected graph (i.e., all vertices are connected by paths, but removing any edge disconnects) A tree is a connected graph with one less edge than vertex. A tree is a maximally acyclic graph (i.e., it contains no cycles, but adding another edge creates one or more cycles)

Changing Tree Geometry This is a typical tree to a computer scientist. properties: ______ _______ Vertices are often called _____.

The extreme “ends” of a tree A ____is a node at the extreme end of a path from the root (i.e., there are no edges to allow the path to continue). Identify the leaves in the following trees.

Trees can be taller/shorter A _______of a tree is the number of nodes in its longest path from root to leaf.

Directed Trees Tree edges are directed from the root outward. A ______node shares an edge with every ______. The parent is “closer to” the root. Def’n: rooted (directed) tree Every node, except the root, has exactly one parent. Def’n: rooted (directed) tree Every node, except the root, has exactly one parent.

The tree’s “extended family” If n 1 is the parent of n 2, then n 1 is n 2 ’s ancestor. ancestor If n 1 is the parent of n a and n a is an ancestor of n 2, then n 1 is n 2 ’s ancestor. If n 1 is the ancestor of n 2, then n 2 is n 1 ’s descendant. descendant The level of a node is the number of edges in its path to the root. level

Subtrees Any node of a tree, together with all of its descendants and associated edges, forms a subtree. subtree Example: the subtree rooted at F

Expression Trees - An Application An expression tree is a tree in which a node contains either an operand or operator and each subtree represents a subexpression of the whole. Example: (1 + 2) * (3 - 4) / -(5 * 6)

Decision Trees - Another Application A decision tree maintains yes/no questions in each non-leaf node, and each left subtree is for “no” while the right subtree is for “yes”. Example