Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 Consider the adjacency list representation of a graph with 8 vertices and 9 edges: A: E F B B: C A C: B

Question 1

Consider the adjacency list representation of a graph with 8 vertices and 9 edges: A: E F B B: C A C: B G F D: H G E: A F: G C A G: F D C H: D Here is a graphical representation of the same graph: (A)-------------(B)-------------(C) (D) |\ /| /| | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / | / | | \ / |/ | (E) (F)-------------(G) (H) Run depth first search from vertex A. Give the sequence in which depth first search first visits the vertices. Make sure that you use the order given in the adjacency list! 

Options:

a)

A E B C F G D H

b)

A B C G D H E F

c)

A E F G D H C B

d)

A B C E F G D H

e)

A E F B C G D H

Question 2 Consider the adjacency list representation of a graph with 8 vertices and 10 edges: 0: 1 1: 0 2 4 5 2: 1 6 5 3 3: 6 2 4: 1 5 5: 1 4 2 6: 3 7 2 7: 6 Here is a graphical representation of the same graph: (0)-------------(1)-------------(2)-------------(3) /| /| / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / |/ |/ (4)-------------(5) (6)-------------(7) Run depth first search from vertex 6 and calculate the values of the edgeTo[] array. Match the edgeTo[] array elements with their calculated values. 
Note that edgeTo[6] is not included since it is not assigned for a new DepthFirstPaths(G, 6) instance with source vertex 6. Be sure to use the order from the adjacency list! 

edgeTo[0]

edgeTo[1]

edgeTo[2]

edgeTo[3]

edgeTo[4]

edgeTo[5]

edgeTo[7]

Question 3

Consider the adjacency-lists representation of a graph with 8 vertices and 10 edges: A: B B: A C E F C: B G F D D: G C E: B F F: B E C G: D H C H: G Here is a graphical representation of the same graph: (A)-------------(B)-------------(C)-------------(D) /| /| / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / | / | / / |/ |/ (E)-------------(F) (G)-------------(H) Run breath-first search from vertex A. Give the sequence in which the vertices are dequeued from the FIFO queue. Make sure that you use the order in the adjacency list! 

Options:

A B C F E G D H

A B E F C G D H

A B C F E G D H

A B E F C D G H

A B C E F G D H

 

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

Machine Learning And Knowledge Discovery In Databases European Conference Ecml Pkdd 2017 Skopje Macedonia September 18 22 2017 Proceedings Part 3 Lnai 10536

Authors: Yasemin Altun ,Kamalika Das ,Taneli Mielikainen ,Donato Malerba ,Jerzy Stefanowski ,Jesse Read ,Marinka Zitnik ,Michelangelo Ceci ,Saso Dzeroski

1st Edition

3319712721, 978-3319712727

More Books

Students also viewed these Databases questions