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 145 times
Edit
0
Community EvaluationsNo one has reviewed this question yet, be the first!
2
What is the complexity of this algorithm?5
What does the While loop do?7
What is special about quick sort?7
What type of structure are the results of a recursive function stored in?4
What about the merge sort method?9
What is recursion?2
Given an array of 17 elements sorted in ascending order, what is the cost of accessing the element with index 10?