Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In python D repl x 0 replit- O repl.it- cosc32 | Chttps//replit/student/submissions/5717235 COSC3. ER ERDpu | G gmail. IG Pre-lnt( repl.it HW8- P1.Are th

In python image text in transcribed
image text in transcribed
image text in transcribed
D repl x 0 replit- O repl.it- " cosc32 | Chttps//replit/student/submissions/5717235 COSC3. ER ERDpu | G gmail. IG Pre-lnt( repl.it HW8- P1.Are th Please verify your email. i share your program back to classroom onhance your work affer submitting O export to repl run 1-def adjacent list(graph, node_1, node 2): # Your code here 4-def adjacent matrix(graph, node_1, node_2): e Your code here BONUS # Your bonus code here. Remove the print statement 8 def adjacent(graph, node_1, node 2): ie print ('Not Implemented') Python 3.6.1 (default, Dec 2015, 13:5:11) [GCC 4.8.2] on linx y adjacent? 88 repl talk my repls student learn/teach notifications MichoelBa... Resend verification link Due: Feb 25,2019 11:59 pm (late) submit Instructions from your teacher Are they adjacent? In this assignment you will write two functions which will both determine if two vertices are adjacent. One will work on matrix representations, one will work on list representations. They will both take the representation of the graph as the first argument and the two vertices to check in the second and third arguments. In this assignment, we will assume all graphs are bidirectional and unweighted. Nodes will be labeled with integers for ease of coding Example graph: 0 2 4 11:03 AM 28/02/2019 hp ey adjacent? aarepl talk rmy repls student kaam/teach notificationsMchaole Resend verification link Due: Feb 25, 2019 11:59 pm (late Instructions from your teacher Its list representation: graph list e, 2, 3, 4], Its matrix representation: graph matrix- [ Expected behavior adjacent list(graph 1ist, e, 1)-True adjacent list(graph l1st, 0, 2)-False adjacent list(graph list, 1,4) True odjacent 1ist(graph list, 4, 2) False odjacent matrix(graph matrix, 0, 1) True adjacent matrix(graph-matrix,'e, 2) False adjocent matrix(graph matrix, 14- True adjecent matrix(graph mateix, 4, 2) False Bonusr points 11:04 AM pa ^ gx 28/02/2019

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Identify the cause of a performance problem. page 363

Answered: 1 week ago