0% found this document useful (0 votes)
6 views18 pages

Trees

The document provides an overview of trees as a mathematical structure, detailing their properties such as being undirected, connected, and acyclic. It explains concepts related to rooted trees, including terms like level, height, parent, child, and various types of trees such as M-ary trees and spanning trees. Additionally, it mentions algorithms for finding minimum spanning trees and shortest paths in graphs.

Uploaded by

ltorres6129ant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views18 pages

Trees

The document provides an overview of trees as a mathematical structure, detailing their properties such as being undirected, connected, and acyclic. It explains concepts related to rooted trees, including terms like level, height, parent, child, and various types of trees such as M-ary trees and spanning trees. Additionally, it mentions algorithms for finding minimum spanning trees and shortest paths in graphs.

Uploaded by

ltorres6129ant
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 18

TREES

TREES
Tree
Is a mathematical structure that is a
special kind of graph which has the
following properties:
• undirected
• Connected
• acyclic

• bridge
• components
• forest
Examples of Trees with
Corresponding Number of Vertices
and Edges
Trees on Chemical Structure
H H

H C H H C H

H H C H

H C H

H
Rooted Trees
• A tree is called a rooted tree if one vertex has been designated the
root.
• ROOT – usually refers to a top – most vertex that extends downward
meaning each edge is simply directed away from the root.
• FREE ROOT – a tree without any designated root.
Rooted Trees
Terms to remember
• Level (or depth) – in a rooted tree, the vertex is its distance from the
root.
• Height – height of a tree is the number of vertices or edges traversed
from the root to get the most distant vertex.
• Parent – is the vertex connected to it on the path to the root.
• Child (or offspring)- vertex d is a vertex of which a is a parent.
• Sibling – is a vertex which shares the same parent.
Continuation
• Descendant – is a vertex which is further away from the root than
some other vertex.
• Ancestors – is any vertex between a given vertex and the root.
• Terminal vertex (or leaf) – is a vertex with no children.
• Internal vertex (or branch vertex) – is a vertex that has at least one
child.
• Sub – tree – a smaller portion of a tree starting at some specifies
vertex.
Terms

a c
b
e
d f g h
i
M-ary
• Complete
• Full
• Balanced
Traversal
r • Breadth-first
• Inorder
a b • Preorder
• Postorder

c d e f
Traversal
r • Breadth-first
• Inorder
a b • Preorder
• Postorder

c d e f
Traversal
r • Breadth-first
• Inorder
a b • Preorder
• Postorder

c d e f
Traversal
r • Breadth-first
• Inorder
a b • Preorder
• Postorder

c d e f
• Spanning Tree – is a subgraph which is tree and contains all vertices of
the graph.
• Prim’s algorithm – developed by Robert Clay in 1957 which is a greedy
algorithm that determines a minimum spanning tree for a connected
weighted undirected graph.
• Kruskal’s algorithm – developed by Joseph Bernard Kruskal (1928-
2010).
• Dijkstra’s algorithm – developed by Edsger W. Dijkstra (1930 – 2002).
The algorithm is a graph search algorithm that determines the single –
source shortest – path problem for a graph producing a shortest path
tree.

You might also like