Question from the Algorithmics - Fundamentals test

What is the function of the following code applied to the graph G?

Hard

What is the function of the following code applied to the graph G?

    function browse(Graph G, Vertex s) 
    { 
            create_a_queue; 
            put s at the top of the queue; 
            label s; 
             While the queue is not empty 
            { 
                    remove s from the queue; 
                    For all neighbors v of s in G 
                    { 
                            If v is not labeled 
                           { 
                                put v in the queue; 
                                label v; 
                            }
                        }
                    }
                }
Author: KahinaStatus: PublishedQuestion passed 115 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!