SlideShare a Scribd company logo
1 of 1
Download to read offline
1. Compute and draw the adjacency matrix and adjacency list representations of the above graph.
(2 pts) 2. Does the above graph have an Eulerian path (a path that visits every edge exactly once?
What is your criteria for deciding existence of an Eulerian path? (2 pts) 3. Consider the following
Graph class partial implementation. Implement the missing functions. (5 pts) 4. Using your
implemented code below draw the dfs tree starting from node 4 of the above graph. (1 pts) public
class Graph { int n;// number of vertices int m;// number of edges // vertices labeled from 0 to (n1)
int[]] A; // adjacency matrix boolean[] visited; // to track dfs searched vertices int[] parent; int[]
degree; // degree of each vertex public Graph(int n, String[] edges) { this. n=n; this.m =
edges.length; A=new int [n][n]; for (int u=0;u<n;u++ ) { for (int v=0;v<n;v++){ A[u][v]=0;// implement
depth first search from node u public void dfs(int u ) { // TODO: code goes here to implement DFS
} public void printAdjMatrix() { for (int u=0;u<n;u++ ) { for (int v=0;v<n;v++ ) { System.out.print(A[u] [
v]+ " ); } System.out.println(); } } public void printParentTree() { for (int u=0;u<n;u++ ) {
System.out.print(parent[u] +" "); } System.out.print ln(); } // test whether sum of degrees equals
twice the number of edges boolean checkHandshakingLemma() { // TODO: code goes here to
check handshaking lemma } // test whether the graph has an eulerian path boolean testEulerian ()
{ // TODO: code goes here to check for existence of eulerian path }

More Related Content

Similar to 1 Compute and draw the adjacency matrix and adjacency list .pdf

Lec5 pagerank
Lec5 pagerankLec5 pagerank
Lec5 pagerankCarlos
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerankmobius.cn
 
Social network-analysis-in-python
Social network-analysis-in-pythonSocial network-analysis-in-python
Social network-analysis-in-pythonJoe OntheRocks
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generationIffat Anjum
 
Preparation Data Structures 11 graphs
Preparation Data Structures 11 graphsPreparation Data Structures 11 graphs
Preparation Data Structures 11 graphsAndres Mendez-Vazquez
 
Ch01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonCh01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonshin
 
C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1 C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1 Mohammad Shaker
 
Pagerank (from Google)
Pagerank (from Google)Pagerank (from Google)
Pagerank (from Google)Sri Prasanna
 
Using an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdfUsing an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdfgiriraj65
 
Graph convolutional networks in apache spark
Graph convolutional networks in apache sparkGraph convolutional networks in apache spark
Graph convolutional networks in apache sparkEmiliano Martinez Sanchez
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functionsjoellivz
 
Create a Java non-GUI stand-alone application that displays a histog
Create a Java non-GUI stand-alone application that displays a histogCreate a Java non-GUI stand-alone application that displays a histog
Create a Java non-GUI stand-alone application that displays a histogkedsliemichal
 
Java Algorithm Interview Questions & Answers .pdf
Java Algorithm Interview Questions & Answers .pdfJava Algorithm Interview Questions & Answers .pdf
Java Algorithm Interview Questions & Answers .pdfNiravPanchal50
 
MapReduceAlgorithms.ppt
MapReduceAlgorithms.pptMapReduceAlgorithms.ppt
MapReduceAlgorithms.pptCheeWeiTan10
 
Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Gopi Saiteja
 

Similar to 1 Compute and draw the adjacency matrix and adjacency list .pdf (20)

Lec5 pagerank
Lec5 pagerankLec5 pagerank
Lec5 pagerank
 
Lec5 Pagerank
Lec5 PagerankLec5 Pagerank
Lec5 Pagerank
 
Social network-analysis-in-python
Social network-analysis-in-pythonSocial network-analysis-in-python
Social network-analysis-in-python
 
Lecture 12 intermediate code generation
Lecture 12 intermediate code generationLecture 12 intermediate code generation
Lecture 12 intermediate code generation
 
Preparation Data Structures 11 graphs
Preparation Data Structures 11 graphsPreparation Data Structures 11 graphs
Preparation Data Structures 11 graphs
 
K031065069
K031065069K031065069
K031065069
 
Programs.doc
Programs.docPrograms.doc
Programs.doc
 
AI-Programs.pdf
AI-Programs.pdfAI-Programs.pdf
AI-Programs.pdf
 
Ch01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluitonCh01 basic concepts_nosoluiton
Ch01 basic concepts_nosoluiton
 
C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1 C++ Windows Forms L08 - GDI P1
C++ Windows Forms L08 - GDI P1
 
Pagerank (from Google)
Pagerank (from Google)Pagerank (from Google)
Pagerank (from Google)
 
Using an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdfUsing an Array include ltstdiohgt include ltmpih.pdf
Using an Array include ltstdiohgt include ltmpih.pdf
 
Graph convolutional networks in apache spark
Graph convolutional networks in apache sparkGraph convolutional networks in apache spark
Graph convolutional networks in apache spark
 
Introduction to Matlab - Basic Functions
Introduction to Matlab - Basic FunctionsIntroduction to Matlab - Basic Functions
Introduction to Matlab - Basic Functions
 
Create a Java non-GUI stand-alone application that displays a histog
Create a Java non-GUI stand-alone application that displays a histogCreate a Java non-GUI stand-alone application that displays a histog
Create a Java non-GUI stand-alone application that displays a histog
 
Java Algorithm Interview Questions & Answers .pdf
Java Algorithm Interview Questions & Answers .pdfJava Algorithm Interview Questions & Answers .pdf
Java Algorithm Interview Questions & Answers .pdf
 
Chapter 5 Syntax Directed Translation
Chapter 5   Syntax Directed TranslationChapter 5   Syntax Directed Translation
Chapter 5 Syntax Directed Translation
 
MapReduceAlgorithms.ppt
MapReduceAlgorithms.pptMapReduceAlgorithms.ppt
MapReduceAlgorithms.ppt
 
18 Basic Graph Algorithms
18 Basic Graph Algorithms18 Basic Graph Algorithms
18 Basic Graph Algorithms
 
Ee693 sept2014quizgt1
Ee693 sept2014quizgt1Ee693 sept2014quizgt1
Ee693 sept2014quizgt1
 

More from atwaytvl

1 Consider the metaphor operating in Platos Parable of the.pdf
1 Consider the metaphor operating in Platos Parable of the.pdf1 Consider the metaphor operating in Platos Parable of the.pdf
1 Consider the metaphor operating in Platos Parable of the.pdfatwaytvl
 
1 Assume X1 Xn are iid fx It is desired to esti.pdf
1 Assume X1     Xn are iid fx It is desired to esti.pdf1 Assume X1     Xn are iid fx It is desired to esti.pdf
1 Assume X1 Xn are iid fx It is desired to esti.pdfatwaytvl
 
1 are a transitional reptile between reptiles and true mamm.pdf
1 are a transitional reptile between reptiles and true mamm.pdf1 are a transitional reptile between reptiles and true mamm.pdf
1 are a transitional reptile between reptiles and true mamm.pdfatwaytvl
 
1 An imaging department receives paper documents they scan .pdf
1 An imaging department receives paper documents they scan .pdf1 An imaging department receives paper documents they scan .pdf
1 An imaging department receives paper documents they scan .pdfatwaytvl
 
1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf
1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf
1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdfatwaytvl
 
1 An important aspect of transport by facilitated transport.pdf
1 An important aspect of transport by facilitated transport.pdf1 An important aspect of transport by facilitated transport.pdf
1 An important aspect of transport by facilitated transport.pdfatwaytvl
 
1 All vertebrate embryos undergo the process of gastrulatio.pdf
1 All vertebrate embryos undergo the process of gastrulatio.pdf1 All vertebrate embryos undergo the process of gastrulatio.pdf
1 All vertebrate embryos undergo the process of gastrulatio.pdfatwaytvl
 
1 Analyze risk factors for altered urinary elimination and .pdf
1 Analyze risk factors for altered urinary elimination and .pdf1 Analyze risk factors for altered urinary elimination and .pdf
1 Analyze risk factors for altered urinary elimination and .pdfatwaytvl
 
1 Al desarrollar un programa de prueba capacitacin y ejer.pdf
1 Al desarrollar un programa de prueba capacitacin y ejer.pdf1 Al desarrollar un programa de prueba capacitacin y ejer.pdf
1 Al desarrollar un programa de prueba capacitacin y ejer.pdfatwaytvl
 
1 According to Michael Green in The Global Goals we have .pdf
1 According to Michael Green in The Global Goals we have .pdf1 According to Michael Green in The Global Goals we have .pdf
1 According to Michael Green in The Global Goals we have .pdfatwaytvl
 
1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf
1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf
1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdfatwaytvl
 
1 Assume that the Ricardian Equivalence Principle does not .pdf
1 Assume that the Ricardian Equivalence Principle does not .pdf1 Assume that the Ricardian Equivalence Principle does not .pdf
1 Assume that the Ricardian Equivalence Principle does not .pdfatwaytvl
 
1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf
1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf
1 ACyclical Reldundancy Check CAC is an example of vhat t.pdfatwaytvl
 
1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf
1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf
1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdfatwaytvl
 
1 As an EN you need to be able to accurately interpret and .pdf
1 As an EN you need to be able to accurately interpret and .pdf1 As an EN you need to be able to accurately interpret and .pdf
1 As an EN you need to be able to accurately interpret and .pdfatwaytvl
 
1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf
1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf
1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdfatwaytvl
 
1 As a consultant to the Apollo Hospital you were asked to.pdf
1 As a consultant to the Apollo Hospital you were asked to.pdf1 As a consultant to the Apollo Hospital you were asked to.pdf
1 As a consultant to the Apollo Hospital you were asked to.pdfatwaytvl
 
1 Are the X and Y chromosomes identical to each other Are .pdf
1 Are the X and Y chromosomes identical to each other Are .pdf1 Are the X and Y chromosomes identical to each other Are .pdf
1 Are the X and Y chromosomes identical to each other Are .pdfatwaytvl
 
1 Ana bulut grubunun tanmn ve trn eletirin Sirs C.pdf
1 Ana bulut grubunun tanmn ve trn eletirin    Sirs C.pdf1 Ana bulut grubunun tanmn ve trn eletirin    Sirs C.pdf
1 Ana bulut grubunun tanmn ve trn eletirin Sirs C.pdfatwaytvl
 
1 Consider the continuoustime LTI system with impulse resp.pdf
1 Consider the continuoustime LTI system with impulse resp.pdf1 Consider the continuoustime LTI system with impulse resp.pdf
1 Consider the continuoustime LTI system with impulse resp.pdfatwaytvl
 

More from atwaytvl (20)

1 Consider the metaphor operating in Platos Parable of the.pdf
1 Consider the metaphor operating in Platos Parable of the.pdf1 Consider the metaphor operating in Platos Parable of the.pdf
1 Consider the metaphor operating in Platos Parable of the.pdf
 
1 Assume X1 Xn are iid fx It is desired to esti.pdf
1 Assume X1     Xn are iid fx It is desired to esti.pdf1 Assume X1     Xn are iid fx It is desired to esti.pdf
1 Assume X1 Xn are iid fx It is desired to esti.pdf
 
1 are a transitional reptile between reptiles and true mamm.pdf
1 are a transitional reptile between reptiles and true mamm.pdf1 are a transitional reptile between reptiles and true mamm.pdf
1 are a transitional reptile between reptiles and true mamm.pdf
 
1 An imaging department receives paper documents they scan .pdf
1 An imaging department receives paper documents they scan .pdf1 An imaging department receives paper documents they scan .pdf
1 An imaging department receives paper documents they scan .pdf
 
1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf
1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf
1 Aerobik hcresel solunum en iyi ekilde u ekilde tanmlanab.pdf
 
1 An important aspect of transport by facilitated transport.pdf
1 An important aspect of transport by facilitated transport.pdf1 An important aspect of transport by facilitated transport.pdf
1 An important aspect of transport by facilitated transport.pdf
 
1 All vertebrate embryos undergo the process of gastrulatio.pdf
1 All vertebrate embryos undergo the process of gastrulatio.pdf1 All vertebrate embryos undergo the process of gastrulatio.pdf
1 All vertebrate embryos undergo the process of gastrulatio.pdf
 
1 Analyze risk factors for altered urinary elimination and .pdf
1 Analyze risk factors for altered urinary elimination and .pdf1 Analyze risk factors for altered urinary elimination and .pdf
1 Analyze risk factors for altered urinary elimination and .pdf
 
1 Al desarrollar un programa de prueba capacitacin y ejer.pdf
1 Al desarrollar un programa de prueba capacitacin y ejer.pdf1 Al desarrollar un programa de prueba capacitacin y ejer.pdf
1 Al desarrollar un programa de prueba capacitacin y ejer.pdf
 
1 According to Michael Green in The Global Goals we have .pdf
1 According to Michael Green in The Global Goals we have .pdf1 According to Michael Green in The Global Goals we have .pdf
1 According to Michael Green in The Global Goals we have .pdf
 
1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf
1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf
1 Aadaki iskelet forml Dlsini stte ve Llsini alt.pdf
 
1 Assume that the Ricardian Equivalence Principle does not .pdf
1 Assume that the Ricardian Equivalence Principle does not .pdf1 Assume that the Ricardian Equivalence Principle does not .pdf
1 Assume that the Ricardian Equivalence Principle does not .pdf
 
1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf
1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf
1 ACyclical Reldundancy Check CAC is an example of vhat t.pdf
 
1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf
1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf
1 Aadaki ilemlerden hangisi tuzluluu arttrr deniz suyu A.pdf
 
1 As an EN you need to be able to accurately interpret and .pdf
1 As an EN you need to be able to accurately interpret and .pdf1 As an EN you need to be able to accurately interpret and .pdf
1 As an EN you need to be able to accurately interpret and .pdf
 
1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf
1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf
1 Aadakilerden hangisi bir mikrotbl ilevi olarak tannmaz.pdf
 
1 As a consultant to the Apollo Hospital you were asked to.pdf
1 As a consultant to the Apollo Hospital you were asked to.pdf1 As a consultant to the Apollo Hospital you were asked to.pdf
1 As a consultant to the Apollo Hospital you were asked to.pdf
 
1 Are the X and Y chromosomes identical to each other Are .pdf
1 Are the X and Y chromosomes identical to each other Are .pdf1 Are the X and Y chromosomes identical to each other Are .pdf
1 Are the X and Y chromosomes identical to each other Are .pdf
 
1 Ana bulut grubunun tanmn ve trn eletirin Sirs C.pdf
1 Ana bulut grubunun tanmn ve trn eletirin    Sirs C.pdf1 Ana bulut grubunun tanmn ve trn eletirin    Sirs C.pdf
1 Ana bulut grubunun tanmn ve trn eletirin Sirs C.pdf
 
1 Consider the continuoustime LTI system with impulse resp.pdf
1 Consider the continuoustime LTI system with impulse resp.pdf1 Consider the continuoustime LTI system with impulse resp.pdf
1 Consider the continuoustime LTI system with impulse resp.pdf
 

Recently uploaded

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and ModificationsMJDuyan
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
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
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.pptRamjanShidvankar
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptxMaritesTamaniVerdade
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxRamakrishna Reddy Bijjam
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxDenish Jangid
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxAreebaZafar22
 
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
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfDr Vijay Vishwakarma
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
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
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
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
 

Recently uploaded (20)

Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
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
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Application orientated numerical on hev.ppt
Application orientated numerical on hev.pptApplication orientated numerical on hev.ppt
Application orientated numerical on hev.ppt
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
2024-NATIONAL-LEARNING-CAMP-AND-OTHER.pptx
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.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Ă...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
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
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
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
 

1 Compute and draw the adjacency matrix and adjacency list .pdf

  • 1. 1. Compute and draw the adjacency matrix and adjacency list representations of the above graph. (2 pts) 2. Does the above graph have an Eulerian path (a path that visits every edge exactly once? What is your criteria for deciding existence of an Eulerian path? (2 pts) 3. Consider the following Graph class partial implementation. Implement the missing functions. (5 pts) 4. Using your implemented code below draw the dfs tree starting from node 4 of the above graph. (1 pts) public class Graph { int n;// number of vertices int m;// number of edges // vertices labeled from 0 to (n1) int[]] A; // adjacency matrix boolean[] visited; // to track dfs searched vertices int[] parent; int[] degree; // degree of each vertex public Graph(int n, String[] edges) { this. n=n; this.m = edges.length; A=new int [n][n]; for (int u=0;u<n;u++ ) { for (int v=0;v<n;v++){ A[u][v]=0;// implement depth first search from node u public void dfs(int u ) { // TODO: code goes here to implement DFS } public void printAdjMatrix() { for (int u=0;u<n;u++ ) { for (int v=0;v<n;v++ ) { System.out.print(A[u] [ v]+ " ); } System.out.println(); } } public void printParentTree() { for (int u=0;u<n;u++ ) { System.out.print(parent[u] +" "); } System.out.print ln(); } // test whether sum of degrees equals twice the number of edges boolean checkHandshakingLemma() { // TODO: code goes here to check handshaking lemma } // test whether the graph has an eulerian path boolean testEulerian () { // TODO: code goes here to check for existence of eulerian path }