1 / 16

Ch. 10 Trees

Ch. 10 Trees. 10.1 Intro. 4 Examples – trees or not?. Example of ___. Rooted tree. Definitions. Def .: Tree - a connected undirected graph with no simple circuits Forest -

cree
Download Presentation

Ch. 10 Trees

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Ch. 10 Trees 10.1 Intro

  2. 4 Examples – trees or not?

  3. Example of ___

  4. Rooted tree

  5. Definitions Def.: • Tree- a connected undirected graph with no simple circuits • Forest- • Rooted tree- tree with a root --i.e. a tree where one vertex is designated as the root and every other edge is directed away from it (ex: descendents, ancestors,…) • Leaf- vertex of tree with no children • Internal vertex-vertex with children

  6. More Def: • m-arytree: a rooted tree where every internal vertex has no more than m children • Special case: m=2 is a binary tree • full m-ary tree: an m-ary tree where every internal vertex has exactly m children.

  7. Full M-arytrees

  8. Q: Is this an M-arytree? (m=__?)Is it a Full M-ary tree?

  9. Is this a full M-ary(if so, m=__?)

  10. Uses of trees • Geneology • Organizational chart • Chain letters • Sales organizations- pyramids • Computer science -- searching, sorting, coding • Chemistry • Counting

  11. Theorem 1 Theorem 1: An undirected graph is a tree iff there is a unique simple path between any of the vertices. Proof: Assume that there is a unique simple path between any two vertices. Therefore, the graph is ____ To show that it is a tree, show that ____________ To see this, suppose T has a simple circuit containing x and y. There, there would be ________ This is a contradiction. So, we conclude that ___________ …

  12. …proof Theorem 1: An undirected graph is a tree iff there is a unique simple path between any of the vertices. …proof: Assume T is a tree. So T is connected and there exists a path between ________ Let x and y be vertices. To see that there exists a unique simple path, assume not. So, assume that there are 2 paths. Therefore, there is a ________. Thm. 1 from 9.4 says that it is simple. So it is not a tree, and we have a contradiction. In conclusion, ___________

  13. Thm. 2, 3 Theorem 2: A tree with n vertices has n-1 edges Theorem 3: A full m-ary tree with i internal vertices contains n=mi+1 vertices Note: full m-ary tree: n=mi+1, n=l+i

  14. Thm. 4 Theorem 4: A full m-ary tree with n vertices has i=(n-1)/m and l=n – i i internal vertices has n=mi+1 and l=n - i l leaves has i=(l-1)/(m-1) and n=l+i Pf:

  15. Ex Ex: A chain starts when a person sends it to 5 others. These either ignore it or send it to 5 more. If 21 people receive it, how many sent it? Did not? N=21, i= ? l = 17? Ex: 5-ary 2001 see it=n Number who sent it=? Number who didn’t=?

  16. …Ex Ex: 5-ary chain letter 10,000 send it Number who receive it= ? Number who don’t send it = ?

More Related