SlideShare a Scribd company logo
1 of 44
UNIT 5
BINARY Trees
General Trees
Definition:
A tree is a connected undirected graph with
no circuits.
Recall: A circuit is a path that begins and
ends a the same vertex.
d
d
A Family Tree
Much of the tree terminology derives from
family trees.
Gaea
Cronus
Phoebe
Ocean
Zeus Poseidon Demeter Pluto Leto Iapetus
Persephone
Apollo Atlas Prometheus
Rooted tree
A rooted tree is a tree
where one of its vertices
is
designated the root
Rooted Trees
a
b
c
d
e f
g
a
b
c
d
e
f
g
Ordered Rooted Tree
An ordered rooted tree is a rooted tree
where the children of each internal vertex
are ordered.
If in a tree at each level , an ordering is
defined, such a tree is called an ordered
tree.
Definition..
 A binary tree is a tree
data structure in
which each parent
node can have at
most two children
 which are referred to
as the left child and the
right child.
Terminology
 Parent
 Ancestor
 Child
 Descendant
 Siblings
 Root
 Left child
 Right Child
 Leaf
 Terminal vertices
 Internal vertices
 Subtrees(Left subtree ,right
subtree)
root node
a
b c
d e f g
h i
parent of g
siblings
leaf
internal vertex
a
b c
d e f g
h i
subtree with b as its
root
subtree with c as its
root
a
b c
d e f g
h i ancestors of h and i
Properties of Trees
1- Edges :A tree with n vertices has n-1
edges.
Properties of Trees
2-Level :- The level of a vertex v in a
rooted tree is the length of the unique path
from the root to this vertex.
LEVEL 1
level 2
level 3
Properties of Trees
The height or depth of a rooted tree is the
maximum of the levels of vertices.
Internal and external vertices
 An internal vertex is a
vertex that has at least one
child
 A terminal vertex is a
vertex that has no children
 The tree in the example
has 4 internal vertices and
4 terminal vertices
Example : for the tree given find
the following
 Root
 node leaves,
 parent node of each
node,
 depth of each node
 siblings
Full Binary Tree:
binary tree in which every parent node/internal node has either two
or no children
Complete Binary Tree -
A complete binary tree is a binary tree in which all the levels are completely filled
except possibly the lowest one, which is filled from the left.
1.All the leaf elements must lean towards the left.
2.The last leaf element might not have a right sibling
i.e. a complete binary tree doesn't have to be a full binary tree.
7.3 Spanning trees
Given a graph G, a tree T is a
spanning tree of G if:
 T is a subgraph of G
and
 T contains all the vertices of
G
Spanning tree search
 Breadth-first search
method
 Depth-first search
method
(backtracking)
7.4 Minimal spanning trees
Given a weighted graph G,
a minimum spanning tree
is
 a spanning tree of G
 that has minimum
“weight”
1. Prim’s algorithm
 Step 0: Pick any vertex as a
starting vertex (call it a). T = {a}.
 Step 1: Find the edge with
smallest weight incident to a.
Add it to T Also include in T the
next vertex and call it b.
 Step 2: Find the edge of
smallest weight incident to
either a or b. Include in T that
edge and the next incident
vertex. Call that vertex c.
 Step 3: Repeat Step
2, choosing the edge
of smallest weight
that does not form a
cycle until all vertices
are in T. The resulting
subgraph T is a
minimum spanning
tree.
2. Kruskal’s algorithm
 Step 1: Find the edge in
the graph with smallest
weight (if there is more
than one, pick one at
random). Mark it with any
given color, say red.
 Step 2: Find the next
edge in the graph with
smallest weight that
doesn't close a cycle.
Color that edge and the
next incident vertex.
 Step 3: Repeat Step 2 until
you reach out to every vertex
of the graph. The chosen
edges form the desired
minimum spanning tree.
Binary search trees
 Data are associated to
each vertex
 Order data
alphabetically, so that
for each vertex v, data
to the left of v are less
than data in v
 and data to the right of
v are greater than data
in v
 Example: "Computers
are an important
technological tool"

More Related Content

Similar to discrete mathematics binary%20trees.pptx

Farhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructureFarhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructureFarhana Shaikh
 
Data structure using c module 2
Data structure using c module 2Data structure using c module 2
Data structure using c module 2smruti sarangi
 
Lecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptxLecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptxfizzaahmed9
 
Lecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptx
Lecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptxLecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptx
Lecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptxHamzaUsman48
 
Lecture notes data structures tree
Lecture notes data structures   treeLecture notes data structures   tree
Lecture notes data structures treemaamir farooq
 
trees in data structure
trees in data structure trees in data structure
trees in data structure shameen khan
 
Tree terminology and introduction to binary tree
Tree terminology and introduction to binary treeTree terminology and introduction to binary tree
Tree terminology and introduction to binary treejyoti_lakhani
 
Basic Terminologies of Tree and Tree Traversal methods.pptx
Basic Terminologies of Tree and Tree Traversal methods.pptxBasic Terminologies of Tree and Tree Traversal methods.pptx
Basic Terminologies of Tree and Tree Traversal methods.pptx22001003058
 
non linear data structure -introduction of tree
non linear data structure -introduction of treenon linear data structure -introduction of tree
non linear data structure -introduction of treeSiddhi Viradiya
 
Discrete Mathematics Tree
Discrete Mathematics  TreeDiscrete Mathematics  Tree
Discrete Mathematics TreeMasud Parvaze
 
Final tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationFinal tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationnakulvarshney371
 

Similar to discrete mathematics binary%20trees.pptx (20)

07 trees
07 trees07 trees
07 trees
 
Farhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructureFarhana shaikh webinar_treesindiscretestructure
Farhana shaikh webinar_treesindiscretestructure
 
Chapter 8 ds
Chapter 8 dsChapter 8 ds
Chapter 8 ds
 
Data structure using c module 2
Data structure using c module 2Data structure using c module 2
Data structure using c module 2
 
Lecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptxLecture 21_Trees - I.pptx
Lecture 21_Trees - I.pptx
 
Lecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptx
Lecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptxLecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptx
Lecture-7-Binary-Trees-and-Algorithms-11052023-054009pm.pptx
 
Tree and Binary Search tree
Tree and Binary Search treeTree and Binary Search tree
Tree and Binary Search tree
 
Unit – vi tree
Unit – vi   treeUnit – vi   tree
Unit – vi tree
 
Trees.pptx
Trees.pptxTrees.pptx
Trees.pptx
 
Binary tree traversal ppt - 02.03.2020
Binary tree traversal   ppt - 02.03.2020Binary tree traversal   ppt - 02.03.2020
Binary tree traversal ppt - 02.03.2020
 
Lecture notes data structures tree
Lecture notes data structures   treeLecture notes data structures   tree
Lecture notes data structures tree
 
trees in data structure
trees in data structure trees in data structure
trees in data structure
 
Tree terminology and introduction to binary tree
Tree terminology and introduction to binary treeTree terminology and introduction to binary tree
Tree terminology and introduction to binary tree
 
Lecture 5 trees
Lecture 5 treesLecture 5 trees
Lecture 5 trees
 
Basic Terminologies of Tree and Tree Traversal methods.pptx
Basic Terminologies of Tree and Tree Traversal methods.pptxBasic Terminologies of Tree and Tree Traversal methods.pptx
Basic Terminologies of Tree and Tree Traversal methods.pptx
 
Tree
TreeTree
Tree
 
non linear data structure -introduction of tree
non linear data structure -introduction of treenon linear data structure -introduction of tree
non linear data structure -introduction of tree
 
Discrete Mathematics Tree
Discrete Mathematics  TreeDiscrete Mathematics  Tree
Discrete Mathematics Tree
 
Final tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentationFinal tree.ppt tells about tree presentation
Final tree.ppt tells about tree presentation
 
Module - 5_Trees.pdf
Module - 5_Trees.pdfModule - 5_Trees.pdf
Module - 5_Trees.pdf
 

More from ansariparveen06

More from ansariparveen06 (20)

Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).ppt
 
Fundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.pptFundamentals of programming Arduino-Wk2.ppt
Fundamentals of programming Arduino-Wk2.ppt
 
pscheduling.ppt
pscheduling.pptpscheduling.ppt
pscheduling.ppt
 
kmap.pptx
kmap.pptxkmap.pptx
kmap.pptx
 
Combinational_Logic_Circuit.pptx
Combinational_Logic_Circuit.pptxCombinational_Logic_Circuit.pptx
Combinational_Logic_Circuit.pptx
 
presentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptxpresentation_python_7_1569170870_375360.pptx
presentation_python_7_1569170870_375360.pptx
 
BCom-Sem2-Marketing-Digital-payment-Presentation.pptx
BCom-Sem2-Marketing-Digital-payment-Presentation.pptxBCom-Sem2-Marketing-Digital-payment-Presentation.pptx
BCom-Sem2-Marketing-Digital-payment-Presentation.pptx
 
dsa.ppt
dsa.pptdsa.ppt
dsa.ppt
 
11-IOManagement.ppt
11-IOManagement.ppt11-IOManagement.ppt
11-IOManagement.ppt
 
May14ProcessScheduling.ppt
May14ProcessScheduling.pptMay14ProcessScheduling.ppt
May14ProcessScheduling.ppt
 
UNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptxUNIPROCESS SCHEDULING.pptx
UNIPROCESS SCHEDULING.pptx
 
1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx1-introduction-to-dart-programming.pptx
1-introduction-to-dart-programming.pptx
 
CHAP4.pptx
CHAP4.pptxCHAP4.pptx
CHAP4.pptx
 
green IT cooling.pptx
green IT cooling.pptxgreen IT cooling.pptx
green IT cooling.pptx
 
06-Deadlocks.ppt
06-Deadlocks.ppt06-Deadlocks.ppt
06-Deadlocks.ppt
 
chp9 green IT.pptx
chp9 green IT.pptxchp9 green IT.pptx
chp9 green IT.pptx
 
regex.ppt
regex.pptregex.ppt
regex.ppt
 
BOM.ppt
BOM.pptBOM.ppt
BOM.ppt
 
Cooling.pptx
Cooling.pptxCooling.pptx
Cooling.pptx
 
exception%20handlingcpp.pptx
exception%20handlingcpp.pptxexception%20handlingcpp.pptx
exception%20handlingcpp.pptx
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Krashi Coaching
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting DataJhengPantaleon
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonJericReyAuditor
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,Virag Sontakke
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerunnathinaik
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data_Math 4-Q4 Week 5.pptx Steps in Collecting Data
_Math 4-Q4 Week 5.pptx Steps in Collecting Data
 
Science lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lessonScience lesson Moon for 4th quarter lesson
Science lesson Moon for 4th quarter lesson
 
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,भारत-रोम व्यापार.pptx, Indo-Roman Trade,
भारत-रोम व्यापार.pptx, Indo-Roman Trade,
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 
internship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developerinternship ppt on smartinternz platform as salesforce developer
internship ppt on smartinternz platform as salesforce developer
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 

discrete mathematics binary%20trees.pptx

  • 3. Definition: A tree is a connected undirected graph with no circuits. Recall: A circuit is a path that begins and ends a the same vertex.
  • 4.
  • 5. d d
  • 6. A Family Tree Much of the tree terminology derives from family trees. Gaea Cronus Phoebe Ocean Zeus Poseidon Demeter Pluto Leto Iapetus Persephone Apollo Atlas Prometheus
  • 7. Rooted tree A rooted tree is a tree where one of its vertices is designated the root
  • 9. Ordered Rooted Tree An ordered rooted tree is a rooted tree where the children of each internal vertex are ordered. If in a tree at each level , an ordering is defined, such a tree is called an ordered tree.
  • 10.
  • 11. Definition..  A binary tree is a tree data structure in which each parent node can have at most two children  which are referred to as the left child and the right child.
  • 12. Terminology  Parent  Ancestor  Child  Descendant  Siblings  Root  Left child  Right Child  Leaf  Terminal vertices  Internal vertices  Subtrees(Left subtree ,right subtree)
  • 13. root node a b c d e f g h i parent of g siblings leaf internal vertex
  • 14. a b c d e f g h i subtree with b as its root subtree with c as its root
  • 15.
  • 16. a b c d e f g h i ancestors of h and i
  • 17. Properties of Trees 1- Edges :A tree with n vertices has n-1 edges.
  • 18. Properties of Trees 2-Level :- The level of a vertex v in a rooted tree is the length of the unique path from the root to this vertex. LEVEL 1 level 2 level 3
  • 19. Properties of Trees The height or depth of a rooted tree is the maximum of the levels of vertices.
  • 20. Internal and external vertices  An internal vertex is a vertex that has at least one child  A terminal vertex is a vertex that has no children  The tree in the example has 4 internal vertices and 4 terminal vertices
  • 21. Example : for the tree given find the following  Root  node leaves,  parent node of each node,  depth of each node  siblings
  • 22.
  • 23.
  • 24.
  • 25. Full Binary Tree: binary tree in which every parent node/internal node has either two or no children
  • 26. Complete Binary Tree - A complete binary tree is a binary tree in which all the levels are completely filled except possibly the lowest one, which is filled from the left. 1.All the leaf elements must lean towards the left. 2.The last leaf element might not have a right sibling i.e. a complete binary tree doesn't have to be a full binary tree.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39. 7.3 Spanning trees Given a graph G, a tree T is a spanning tree of G if:  T is a subgraph of G and  T contains all the vertices of G
  • 40. Spanning tree search  Breadth-first search method  Depth-first search method (backtracking)
  • 41. 7.4 Minimal spanning trees Given a weighted graph G, a minimum spanning tree is  a spanning tree of G  that has minimum “weight”
  • 42. 1. Prim’s algorithm  Step 0: Pick any vertex as a starting vertex (call it a). T = {a}.  Step 1: Find the edge with smallest weight incident to a. Add it to T Also include in T the next vertex and call it b.  Step 2: Find the edge of smallest weight incident to either a or b. Include in T that edge and the next incident vertex. Call that vertex c.  Step 3: Repeat Step 2, choosing the edge of smallest weight that does not form a cycle until all vertices are in T. The resulting subgraph T is a minimum spanning tree.
  • 43. 2. Kruskal’s algorithm  Step 1: Find the edge in the graph with smallest weight (if there is more than one, pick one at random). Mark it with any given color, say red.  Step 2: Find the next edge in the graph with smallest weight that doesn't close a cycle. Color that edge and the next incident vertex.  Step 3: Repeat Step 2 until you reach out to every vertex of the graph. The chosen edges form the desired minimum spanning tree.
  • 44. Binary search trees  Data are associated to each vertex  Order data alphabetically, so that for each vertex v, data to the left of v are less than data in v  and data to the right of v are greater than data in v  Example: "Computers are an important technological tool"