



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Algorithms Tutorial questions 2019 Semester 1 Tutorial 3
The University of Sydney School of Computer Science
Problem 1
Run a Breadth First Traversal for graph G starting at A. Write the order the nodes are explored.
Solution: Assuming breaking ties lexicographically (i.e., if more than one child pick the one that comes first in lexicographic order). A B,E C,D,F,H G, I
Problem 2
Run a Depth First Traversal for graph G starting at A. Write the order the nodes are explored.
Solution: Assuming breaking ties lexicographically (i.e., if more than one child pick the one that comes first in lexicographic order). A B C D E F G H I
Problem 3
Run a Breadth First Search for graph G starting at A and searching for I. Write out the path that is explored.
A
Solution: A B,E C,F,H D,G,I
Problem 4
Problem 5 Consider the following directed graph G
Solution:
Problem 6 An undirected graph G = (V, E) is said to be bipartite if its vertex set V can be partition into two sets A and B such that E โ A ร B. Design an O(n + m) algorithm to test if a given input graph is bipartite using the following guide: