Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me with part b of Q2! Thank you :) (a) For the given directed graph, draw an adjacency list. (10 points) (b) Assume
Please help me with part b of Q2! Thank you :)
(a) For the given directed graph, draw an adjacency list. (10 points) (b) Assume that the current vertex is ' 1 ' and the visited and the predecessor arrays (size 7) are initialized with "false" and '0', respectively. Show the followings based on the adjacency list developed in (a) and the code. (15 points) - traversal result (searching order of vertices) - the final status of the visited and predecessor arrays. Q2. Adjacency List and Traversal void Search (int current, node** adjList, boot*visited, int* predecessor) i if (visited[current]) return; visited[current]=true; couti=adj List [current]; 1 !=nullptr; i=1->next) \{ if(Ivisited(i->data)) \{ predecessor [1->data]=current; Search ( current: 1>data, adjlist adjlist, visited, predecessor) \} \}Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started