Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

For a graph, n and m denote number of vertices and edges respectively. 1. Write the pseudo code for Depth First Search of G, provided

For a graph, n and m denote number of vertices and edges respectively.

1. Write the pseudo code for Depth First Search of G, provided the Adjacency list is used.

2. Let G = (V,E ) be a graph. Outline an algorithm to determine if G is connected using BFS. What is the time complexity, if G is represented in Adjacency list format.

3. What is the chromatic number of a Cycle on n 3 vertices. a) If n is odd. b) If n is even.

4. Solve T(n) = 3 T( n 3 ) + n , T(1) = 1. You can assume n = 3k .

5. Circle True or False (no justification needed).

a) Any connected graph on n vertices has n 1 edges. True False

b) Chromatic number of a graph is always the minimum degree + 1. True False

c) The longest path in a direted acyclic graph can be found in O( n + m). True False

d) If the post order traversal of two binary trees are identical, then the trees are identical. Two binary trees are identical, if they have the same shape and the same contents. True False

e) BFS traversal can be performed on both directed and undirected graphs. True False

6. Let G = (V, E) be a graph. What is the time complexity of computing minimum degree of G:

a) If G is represented in its Adj. list.

b) If G is represented in its Adj. matrix.

7.Let G = (V, E) be an undirected graph. Describe an algorithm that finds if G has a Cycle or not. What is the time complexity of the algorithm.

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

Students also viewed these Databases questions