CHAPTER 11 TREES. 11.1 INTRODUCTION TO TREES ► A tree is a connected undirected graph with no simple circuit. ► An undirected graph is a tree if and only.

Slides:



Advertisements
Similar presentations
Trees Chapter 11.
Advertisements

Chapter 9 Graphs.
Chapter 10: Trees. Definition A tree is a connected undirected acyclic (with no cycle) simple graph A collection of trees is called forest.
Introduction to Trees Chapter 6 Objectives
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.
1 Copyright M.R.K. Krishna Rao 2003 Ch 9 - Trees Definition: A tree is a connected undirected graph with no simple circuits. Since a tree cannot have a.
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 – CIS166
Discrete Mathematics Transparency No. 8-1 Chapter 8 Trees.
Section 3.1 Properties of Trees Sarah Graham. Tree Talk: Vocabulary oTree: a tree is a special type of graph that contains designated vertex called a.
Lists A list is a finite, ordered sequence of data items. Two Implementations –Arrays –Linked Lists.
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.
MATH 310, FALL 2003 (Combinatorial Problem Solving) Lecture 11, Wednesday, September 24.
Module #1 - Logic 1 Based on Rosen, Discrete Mathematics & Its Applications. Prepared by (c) , Michael P. Frank and Modified By Mingwu Chen Trees.
03/01/2005Tucker, Sec Applied Combinatorics, 4th Ed. Alan Tucker Section 3.1 Properties of Trees Prepared by Joshua Schoenly and Kathleen McNamara.
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.
Trees and Tree Traversals Prof. Sin-Min Lee Department of Computer Science San Jose State University.
Let G be a pseudograph with vertex set V, edge set E, and incidence mapping f. Let n be a positive integer. A path of length n between vertex v and vertex.
May 5, 2015Applied Discrete Mathematics Week 13: Boolean Algebra 1 Dijkstra’s Algorithm procedure Dijkstra(G: weighted connected simple graph with vertices.
BCT 2083 DISCRETE STRUCTURE AND APPLICATIONS
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.
Foundations of Discrete Mathematics
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.
Copyright © Cengage Learning. All rights reserved. CHAPTER 10 GRAPHS AND TREES.
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.
 Rooted tree and binary tree  Theorem 5.19: A full binary tree with t leaves contains i=t-1 internal vertices.
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.
Discrete Structures Trees (Ch. 11)
Chap 8 Trees Def 1: A tree is a connected,undirected, graph with no simple circuits. Ex1. Theorem1: An undirected graph is a tree if and only if there.
Agenda Review: –Planar Graphs Lecture Content:  Concepts of Trees  Spanning Trees  Binary Trees Exercise.
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.
Discrete Mathematics Chapter 5 Trees.
CS 103 Discrete Structures Lecture 23 Trees (1). Second Midterm Exam 1 st Lecture in December (same time as the lecture) 75 minute duration Will cover.
1 Slides by Sylvia Sorkin, Community College of Baltimore County - Essex Campus Trees.
Trees Dr. Yasir Ali. A graph is called a tree if, and only if, it is circuit-free and connected. A graph is called a forest if, and only if, it is circuit-free.
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.
Discrete Structures – CNS 2300 Text Discrete Mathematics and Its Applications (5 th Edition) Kenneth H. Rosen Chapter 9 Trees.
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.
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.
Discrete Mathematics Chapter 10 Trees.
Chapter 11. Chapter Summary  Introduction to trees (11.1)  Application of trees (11.2)  Tree traversal (11.3)  Spanning trees (11.4)
Chapter 11. Chapter Summary Introduction to Trees Applications of Trees (not currently included in overheads) Tree Traversal Spanning Trees Minimum Spanning.
Tree Representation and Terminology Binary Trees Binary Search Trees Pointer-Based Representation of a Binary Tree Array-Based Representation of a Binary.
Section10.1: Introduction to Trees
Applied Discrete Mathematics Week 15: Trees
Graph Graphs and graph theory can be used to model:
Discrete Mathematicsq
Trees Chapter 11.
12. Graphs and Trees 2 Summary
Introduction to Trees Section 11.1.
CS223 Advanced Data Structures and Algorithms
Taibah University College of Computer Science & Engineering Course Title: Discrete Mathematics Code: CS 103 Chapter 10 Trees Slides are adopted from “Discrete.
Discrete Mathematics – CIS166
Trees L Al-zaid Math1101.
Trees 11.1 Introduction to Trees Dr. Halimah Alshehri.
Discrete Mathematics – CIS166
Trees 11.1 Introduction to Trees Dr. Halimah Alshehri.
And the Final Subject is…
Trees Chapter 11.
Presentation transcript:

CHAPTER 11 TREES

11.1 INTRODUCTION TO TREES ► A tree is a connected undirected graph with no simple circuit. ► An undirected graph is a tree if and only if there is a unique simple path between any two of its vertices. ► THEOREM: A tree with n vertices has n – 1 edges. A Tree abc def abc def abc def NOT A TREE A TREE EXAMPLES

11.1 INTRODUCTION TO TREES 1. Which of the following graphs are trees? EXERCISE 4.1 abc de FIGURE 1 ab c d e FIGURE 2 a b cd e FIGURE 3FIGURE 4 v1v1 v2v2 v4v4 v3v3 v5v5

11.1 INTRODUCTION TO TREES ► A rooted tree is a tree in which one vertex has been designated as the root and every edge is directed away from the root. ► Different choice of root produce different rooted tree A Rooted Tree a b c d e fa b c d e f a b c d e f A TREE A TREE with root c A TREE with root a EXAMPLES g g g

11.1 INTRODUCTION TO TREES Parent – A vertex other than root is a parent if it has one or more children  The parent of c is b Children – If A is a vertex with successors B and C, then B and C are the children of A.  The children of a is b, f and g Siblings – Children with the same parent vertex.  h, i and j are siblings Level – the length of the unique path from the root to a vertex  Vertex a is at level 0  Vertices d and e is at level 3 Properties of Rooted Trees a b f g h d EXAMPLES e i j c kl m Height – The maximum level of all the vertices  The height of this tree is 3.

4.1 INTRODUCTION TO TREES Ancestor of a vertex (v) – the vertices in the path from the root to this vertex excluding this vertex.  The ancestors of e are c, b and a Descendent of a vertex (v) – vertices that have v as ancestor.  The descendants of b are c, d and e Leaf – A vertex with no children  The leaves are d, e, f, i, k, l and m Internal Vertices – vertices that have children  The internal vertices are a, b, c, g, h and j Properties of Rooted Trees a b f g h d EXAMPLES e i j c kl m A subtree rooted at g Subtree – A subgraph of the tree consisting of a root and its descendent and all edges incident to these descendent.

11.1 INTRODUCTION TO TREES 2. Answer these questions about the rooted tree illustrated. EXERCISE 4.1 a) Which vertex is the root? b) Which vertices are internal? c) Which vertices are leaves? d) Which vertices are children of g? e) Which vertex is the parent of o? f) Which vertices are siblings of e? g) Which vertices are ancestors of m? h) Which vertices are descendants of d? a b c d h j k r i f n o p eg l m q s e) Find a subgraph. f) Find the level of each vertex. g) What is the height of this tree? h) Is this tree a balanced tree?

11.1 INTRODUCTION TO TREES ► A rooted tree is called an m-ary tree if every vertex has no more than m children. ► The tree is called a full m-ary tree if every internal vertex has exactly m children. m-ary Tree a b cd f a b c d e f A full binary TREE A 3-ary TREE EXAMPLES g g a b c d e f g A full 4-ary TREE e hi j k lm