SlideShare una empresa de Scribd logo
1 de 1
Descargar para leer sin conexión
Question 6. (12 points) The topological sorting algorithm, for a directed acyclic graph with vertices
labeled 0 through n1, can be described by the following pseudocode: 1. Calculate the indegree of
each vertex. 2. Scan the vertices (from 0 to n1 ) and enqueue into queue Q any vertex that has
indegree 0. 3. while Q is not empty: a. Dequeue a vertex v from the queue. Make v the next vertex
in the topological ordering (add it to the end of a list L ). b. Traverse v 's adjacency list. For each
vertex adjacent to v in the graph, decrease its indegree. If that vertex adjacent to v now has
indegree 0 , then enqueue it into the queue. 4. Output the list L. The following is an adjacency list
representation of a graph. It happens to be a directed acyclic graph, which means that the
topological sorting algorithm can be applied to it. - (6 points) First, draw the directed graph that the
adjacency list represents. - (6 points) Second, show what topological ordering the algorithm
outputs. As you execute the topological sorting algorithm, be careful to choose correctly which
vertex gets entered into the queue (based on the pseudocode above) and therefore what order the
vertices are put into list L.

Más contenido relacionado

Similar a Question 6 12 points The topological sorting algorithm f.pdf

NONLINEAR CONTROL SYSTEM (Phase plane & Phase Trajectory Method)
NONLINEAR CONTROL SYSTEM(Phase plane & Phase Trajectory Method)NONLINEAR CONTROL SYSTEM(Phase plane & Phase Trajectory Method)
NONLINEAR CONTROL SYSTEM (Phase plane & Phase Trajectory Method)Niraj Solanki
 
Independence, basis and dimension
Independence, basis and dimensionIndependence, basis and dimension
Independence, basis and dimensionATUL KUMAR YADAV
 
Hoag Ordered Pairs Lesson
Hoag Ordered Pairs LessonHoag Ordered Pairs Lesson
Hoag Ordered Pairs LessonAdrianaHoag
 
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeksBeginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeksJinTaek Seo
 
Chapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic EquationsChapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic EquationsMaria Fernanda
 
Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...
Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...
Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...Hemin Patel
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cyclevarun arora
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksJinTaek Seo
 
21EC33 BSP Module 1.pdf
21EC33 BSP Module 1.pdf21EC33 BSP Module 1.pdf
21EC33 BSP Module 1.pdfRavikiran A
 
1. Introduction.pptx
1. Introduction.pptx1. Introduction.pptx
1. Introduction.pptxSungaleliYuen
 
Linear_Algebra_final.pdf
Linear_Algebra_final.pdfLinear_Algebra_final.pdf
Linear_Algebra_final.pdfRohitAnand125
 
Investigation 8;06
Investigation 8;06Investigation 8;06
Investigation 8;06gdiane
 
Investigation 8;06
Investigation 8;06Investigation 8;06
Investigation 8;06gdiane
 

Similar a Question 6 12 points The topological sorting algorithm f.pdf (20)

NONLINEAR CONTROL SYSTEM (Phase plane & Phase Trajectory Method)
NONLINEAR CONTROL SYSTEM(Phase plane & Phase Trajectory Method)NONLINEAR CONTROL SYSTEM(Phase plane & Phase Trajectory Method)
NONLINEAR CONTROL SYSTEM (Phase plane & Phase Trajectory Method)
 
Independence, basis and dimension
Independence, basis and dimensionIndependence, basis and dimension
Independence, basis and dimension
 
Hoag Ordered Pairs Lesson
Hoag Ordered Pairs LessonHoag Ordered Pairs Lesson
Hoag Ordered Pairs Lesson
 
Brute force
Brute forceBrute force
Brute force
 
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeksBeginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
Beginning direct3d gameprogrammingmath03_vectors_20160328_jintaeks
 
Chapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic EquationsChapter 4: Linear Algebraic Equations
Chapter 4: Linear Algebraic Equations
 
matlab functions
 matlab functions  matlab functions
matlab functions
 
Linear Algebra Assignment help
Linear Algebra Assignment helpLinear Algebra Assignment help
Linear Algebra Assignment help
 
Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...
Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...
Row space, column space, null space And Rank, Nullity and Rank-Nullity theore...
 
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycleBacktracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
Backtracking-N Queens Problem-Graph Coloring-Hamiltonian cycle
 
Range-NUllity-and-Rank.pptx
Range-NUllity-and-Rank.pptxRange-NUllity-and-Rank.pptx
Range-NUllity-and-Rank.pptx
 
Graphs
GraphsGraphs
Graphs
 
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeksBeginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
Beginning direct3d gameprogrammingmath05_matrices_20160515_jintaeks
 
Sub matrices - Circuit Matrix
Sub matrices - Circuit MatrixSub matrices - Circuit Matrix
Sub matrices - Circuit Matrix
 
21EC33 BSP Module 1.pdf
21EC33 BSP Module 1.pdf21EC33 BSP Module 1.pdf
21EC33 BSP Module 1.pdf
 
Graphs
GraphsGraphs
Graphs
 
1. Introduction.pptx
1. Introduction.pptx1. Introduction.pptx
1. Introduction.pptx
 
Linear_Algebra_final.pdf
Linear_Algebra_final.pdfLinear_Algebra_final.pdf
Linear_Algebra_final.pdf
 
Investigation 8;06
Investigation 8;06Investigation 8;06
Investigation 8;06
 
Investigation 8;06
Investigation 8;06Investigation 8;06
Investigation 8;06
 

Más de ADARSHPATNA

Question 6 12 marks Let link cost be equal to the amount .pdf
Question 6 12 marks Let link cost be equal to the amount .pdfQuestion 6 12 marks Let link cost be equal to the amount .pdf
Question 6 12 marks Let link cost be equal to the amount .pdfADARSHPATNA
 
Question 5 of 14 How would you accurately define a journal.pdf
Question 5 of 14 How would you accurately define a journal.pdfQuestion 5 of 14 How would you accurately define a journal.pdf
Question 5 of 14 How would you accurately define a journal.pdfADARSHPATNA
 
Question 5 1 point Name these structures of the internal e.pdf
Question 5 1 point Name these structures of the internal e.pdfQuestion 5 1 point Name these structures of the internal e.pdf
Question 5 1 point Name these structures of the internal e.pdfADARSHPATNA
 
Question 5 Let X be a continuous uniform random variable o.pdf
Question 5 Let X be a continuous uniform random variable o.pdfQuestion 5 Let X be a continuous uniform random variable o.pdf
Question 5 Let X be a continuous uniform random variable o.pdfADARSHPATNA
 
Question 5 Please represent the real numbers in the followi.pdf
Question 5 Please represent the real numbers in the followi.pdfQuestion 5 Please represent the real numbers in the followi.pdf
Question 5 Please represent the real numbers in the followi.pdfADARSHPATNA
 
Question 4 The cross LpqPQQlpqlpq is carried out and the .pdf
Question 4 The cross LpqPQQlpqlpq is carried out and the .pdfQuestion 4 The cross LpqPQQlpqlpq is carried out and the .pdf
Question 4 The cross LpqPQQlpqlpq is carried out and the .pdfADARSHPATNA
 
Question 4 Q4 Describe a positive action you could take in.pdf
Question 4 Q4 Describe a positive action you could take in.pdfQuestion 4 Q4 Describe a positive action you could take in.pdf
Question 4 Q4 Describe a positive action you could take in.pdfADARSHPATNA
 
Question 5 Which statement about G proteins is true G prote.pdf
Question 5 Which statement about G proteins is true G prote.pdfQuestion 5 Which statement about G proteins is true G prote.pdf
Question 5 Which statement about G proteins is true G prote.pdfADARSHPATNA
 
Question 5 Within hybrid zones if the fitness of hybrids is.pdf
Question 5 Within hybrid zones if the fitness of hybrids is.pdfQuestion 5 Within hybrid zones if the fitness of hybrids is.pdf
Question 5 Within hybrid zones if the fitness of hybrids is.pdfADARSHPATNA
 
Question 5 Investment Evaluation Mark Zuckerberg was crazy.pdf
Question 5 Investment Evaluation Mark Zuckerberg was crazy.pdfQuestion 5 Investment Evaluation Mark Zuckerberg was crazy.pdf
Question 5 Investment Evaluation Mark Zuckerberg was crazy.pdfADARSHPATNA
 
Question 5 28 February 2022 Equipment R20 000 Accumulated D.pdf
Question 5 28 February 2022 Equipment R20 000 Accumulated D.pdfQuestion 5 28 February 2022 Equipment R20 000 Accumulated D.pdf
Question 5 28 February 2022 Equipment R20 000 Accumulated D.pdfADARSHPATNA
 
Question 4 You are given the following state table a Dr.pdf
Question 4 You are given the following state table a Dr.pdfQuestion 4 You are given the following state table a Dr.pdf
Question 4 You are given the following state table a Dr.pdfADARSHPATNA
 
Question 4 25 points In his speech Hypponen gives examp.pdf
Question 4 25 points In his speech Hypponen gives examp.pdfQuestion 4 25 points In his speech Hypponen gives examp.pdf
Question 4 25 points In his speech Hypponen gives examp.pdfADARSHPATNA
 
Question 4 10 points Over the past 25 years an economy to.pdf
Question 4 10 points Over the past 25 years an economy to.pdfQuestion 4 10 points Over the past 25 years an economy to.pdf
Question 4 10 points Over the past 25 years an economy to.pdfADARSHPATNA
 
QUESTION 4 UOT Industries has a target debtequity ratio of.pdf
QUESTION 4 UOT Industries has a target debtequity ratio of.pdfQUESTION 4 UOT Industries has a target debtequity ratio of.pdf
QUESTION 4 UOT Industries has a target debtequity ratio of.pdfADARSHPATNA
 
Question 4 15pts Which of the following best describes Pbo.pdf
Question 4 15pts Which of the following best describes Pbo.pdfQuestion 4 15pts Which of the following best describes Pbo.pdf
Question 4 15pts Which of the following best describes Pbo.pdfADARSHPATNA
 
Question 4 Points A Write the definition of a generic con.pdf
Question 4 Points A Write the definition of a generic con.pdfQuestion 4 Points A Write the definition of a generic con.pdf
Question 4 Points A Write the definition of a generic con.pdfADARSHPATNA
 
Question 4 a Let pX VarX be a risk measure associate.pdf
Question 4 a Let pX  VarX be a risk measure associate.pdfQuestion 4 a Let pX  VarX be a risk measure associate.pdf
Question 4 a Let pX VarX be a risk measure associate.pdfADARSHPATNA
 
Question 4 In a classroom of 33 students 19 students are w.pdf
Question 4 In a classroom of 33 students 19 students are w.pdfQuestion 4 In a classroom of 33 students 19 students are w.pdf
Question 4 In a classroom of 33 students 19 students are w.pdfADARSHPATNA
 
Question 4 12 Marks Several established methods exist to a.pdf
Question 4 12 Marks Several established methods exist to a.pdfQuestion 4 12 Marks Several established methods exist to a.pdf
Question 4 12 Marks Several established methods exist to a.pdfADARSHPATNA
 

Más de ADARSHPATNA (20)

Question 6 12 marks Let link cost be equal to the amount .pdf
Question 6 12 marks Let link cost be equal to the amount .pdfQuestion 6 12 marks Let link cost be equal to the amount .pdf
Question 6 12 marks Let link cost be equal to the amount .pdf
 
Question 5 of 14 How would you accurately define a journal.pdf
Question 5 of 14 How would you accurately define a journal.pdfQuestion 5 of 14 How would you accurately define a journal.pdf
Question 5 of 14 How would you accurately define a journal.pdf
 
Question 5 1 point Name these structures of the internal e.pdf
Question 5 1 point Name these structures of the internal e.pdfQuestion 5 1 point Name these structures of the internal e.pdf
Question 5 1 point Name these structures of the internal e.pdf
 
Question 5 Let X be a continuous uniform random variable o.pdf
Question 5 Let X be a continuous uniform random variable o.pdfQuestion 5 Let X be a continuous uniform random variable o.pdf
Question 5 Let X be a continuous uniform random variable o.pdf
 
Question 5 Please represent the real numbers in the followi.pdf
Question 5 Please represent the real numbers in the followi.pdfQuestion 5 Please represent the real numbers in the followi.pdf
Question 5 Please represent the real numbers in the followi.pdf
 
Question 4 The cross LpqPQQlpqlpq is carried out and the .pdf
Question 4 The cross LpqPQQlpqlpq is carried out and the .pdfQuestion 4 The cross LpqPQQlpqlpq is carried out and the .pdf
Question 4 The cross LpqPQQlpqlpq is carried out and the .pdf
 
Question 4 Q4 Describe a positive action you could take in.pdf
Question 4 Q4 Describe a positive action you could take in.pdfQuestion 4 Q4 Describe a positive action you could take in.pdf
Question 4 Q4 Describe a positive action you could take in.pdf
 
Question 5 Which statement about G proteins is true G prote.pdf
Question 5 Which statement about G proteins is true G prote.pdfQuestion 5 Which statement about G proteins is true G prote.pdf
Question 5 Which statement about G proteins is true G prote.pdf
 
Question 5 Within hybrid zones if the fitness of hybrids is.pdf
Question 5 Within hybrid zones if the fitness of hybrids is.pdfQuestion 5 Within hybrid zones if the fitness of hybrids is.pdf
Question 5 Within hybrid zones if the fitness of hybrids is.pdf
 
Question 5 Investment Evaluation Mark Zuckerberg was crazy.pdf
Question 5 Investment Evaluation Mark Zuckerberg was crazy.pdfQuestion 5 Investment Evaluation Mark Zuckerberg was crazy.pdf
Question 5 Investment Evaluation Mark Zuckerberg was crazy.pdf
 
Question 5 28 February 2022 Equipment R20 000 Accumulated D.pdf
Question 5 28 February 2022 Equipment R20 000 Accumulated D.pdfQuestion 5 28 February 2022 Equipment R20 000 Accumulated D.pdf
Question 5 28 February 2022 Equipment R20 000 Accumulated D.pdf
 
Question 4 You are given the following state table a Dr.pdf
Question 4 You are given the following state table a Dr.pdfQuestion 4 You are given the following state table a Dr.pdf
Question 4 You are given the following state table a Dr.pdf
 
Question 4 25 points In his speech Hypponen gives examp.pdf
Question 4 25 points In his speech Hypponen gives examp.pdfQuestion 4 25 points In his speech Hypponen gives examp.pdf
Question 4 25 points In his speech Hypponen gives examp.pdf
 
Question 4 10 points Over the past 25 years an economy to.pdf
Question 4 10 points Over the past 25 years an economy to.pdfQuestion 4 10 points Over the past 25 years an economy to.pdf
Question 4 10 points Over the past 25 years an economy to.pdf
 
QUESTION 4 UOT Industries has a target debtequity ratio of.pdf
QUESTION 4 UOT Industries has a target debtequity ratio of.pdfQUESTION 4 UOT Industries has a target debtequity ratio of.pdf
QUESTION 4 UOT Industries has a target debtequity ratio of.pdf
 
Question 4 15pts Which of the following best describes Pbo.pdf
Question 4 15pts Which of the following best describes Pbo.pdfQuestion 4 15pts Which of the following best describes Pbo.pdf
Question 4 15pts Which of the following best describes Pbo.pdf
 
Question 4 Points A Write the definition of a generic con.pdf
Question 4 Points A Write the definition of a generic con.pdfQuestion 4 Points A Write the definition of a generic con.pdf
Question 4 Points A Write the definition of a generic con.pdf
 
Question 4 a Let pX VarX be a risk measure associate.pdf
Question 4 a Let pX  VarX be a risk measure associate.pdfQuestion 4 a Let pX  VarX be a risk measure associate.pdf
Question 4 a Let pX VarX be a risk measure associate.pdf
 
Question 4 In a classroom of 33 students 19 students are w.pdf
Question 4 In a classroom of 33 students 19 students are w.pdfQuestion 4 In a classroom of 33 students 19 students are w.pdf
Question 4 In a classroom of 33 students 19 students are w.pdf
 
Question 4 12 Marks Several established methods exist to a.pdf
Question 4 12 Marks Several established methods exist to a.pdfQuestion 4 12 Marks Several established methods exist to a.pdf
Question 4 12 Marks Several established methods exist to a.pdf
 

Último

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfNirmal Dwivedi
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentationcamerronhm
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Pooja Bhuva
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Association for Project Management
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseAnaAcapella
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxCeline George
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibitjbellavia9
 

Último (20)

UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
How to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptxHow to setup Pycharm environment for Odoo 17.pptx
How to setup Pycharm environment for Odoo 17.pptx
 
Sociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning ExhibitSociology 101 Demonstration of Learning Exhibit
Sociology 101 Demonstration of Learning Exhibit
 

Question 6 12 points The topological sorting algorithm f.pdf

  • 1. Question 6. (12 points) The topological sorting algorithm, for a directed acyclic graph with vertices labeled 0 through n1, can be described by the following pseudocode: 1. Calculate the indegree of each vertex. 2. Scan the vertices (from 0 to n1 ) and enqueue into queue Q any vertex that has indegree 0. 3. while Q is not empty: a. Dequeue a vertex v from the queue. Make v the next vertex in the topological ordering (add it to the end of a list L ). b. Traverse v 's adjacency list. For each vertex adjacent to v in the graph, decrease its indegree. If that vertex adjacent to v now has indegree 0 , then enqueue it into the queue. 4. Output the list L. The following is an adjacency list representation of a graph. It happens to be a directed acyclic graph, which means that the topological sorting algorithm can be applied to it. - (6 points) First, draw the directed graph that the adjacency list represents. - (6 points) Second, show what topological ordering the algorithm outputs. As you execute the topological sorting algorithm, be careful to choose correctly which vertex gets entered into the queue (based on the pseudocode above) and therefore what order the vertices are put into list L.