Design & Analysis of Algorithms

105402
Back to Design & Analysis of Algorithms

Module 4: Graph and Tree Algorithms

  1. Q1b. BFS on a graph G=(V,E) has running time: - (i) O(|V|+|E|) - (ii) O(|V|) - (iii) O(|E|) - (iv) None of the above20232m

    Module 4: Graph and Tree Algorithms

    BFS on a graph G=(V,E)G=(V,E) has running time:

    • (i) O(V+E)O(|V|+|E|)
    • (ii) O(V)O(|V|)
    • (iii) O(E)O(|E|)
    • (iv) None of the above
    View this question on its own page →
  2. Q1c. The minimum number of colors needed to color a graph having n > 3 vertices and 2 edges is: - (i) 2 - (ii) 3 - (iii) 4 - (iv) 120232m

    Module 4: Graph and Tree Algorithms

    The minimum number of colors needed to color a graph having n>3n > 3 vertices and 2 edges is:

    • (i) 2
    • (ii) 3
    • (iii) 4
    • (iv) 1
    View this question on its own page →
  3. Q1c. Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is 1/2. What is the expected number of unordered cycles of length three? - (i) 1/8 - (ii) 1 - (iii) 8 - (iv) 820192m

    Module 4: Graph and Tree Algorithms

    Consider an undirected random graph of eight vertices. The probability that there is an edge between a pair of vertices is 1/21/2. What is the expected number of unordered cycles of length three?

    • (i) 1/8
    • (ii) 1
    • (iii) 8
    • (iv) 8
    View this question on its own page →
  4. Q1f. Dijkstra's algorithm is used to solve ______ problems? - (i) Single source shortest path - (ii) All pair shortest path - (iii) Sorting - (iv) Searching20242m

    Module 4: Graph and Tree Algorithms

    Dijkstra's algorithm is used to solve ______ problems?

    • (i) Single source shortest path
    • (ii) All pair shortest path
    • (iii) Sorting
    • (iv) Searching
    View this question on its own page →
  5. Q1f. Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph? - (i) In adjacency list representation, space is saved for sparse graphs. - (ii) DFS and BFS can be done in O(V+E) time for adjacency list representation. These operations take O(V^2) time in adjacency matrix representation. - (iii) Adding a vertex in adjacency list representation is easier than adjacency matrix representation. - (iv) All of the above20192m

    Module 4: Graph and Tree Algorithms

    Which of the following is an advantage of adjacency list representation over adjacency matrix representation of a graph?

    • (i) In adjacency list representation, space is saved for sparse graphs.
    • (ii) DFS and BFS can be done in O(V+E)O(V+E) time for adjacency list representation. These operations take O(V2)O(V^2) time in adjacency matrix representation.
    • (iii) Adding a vertex in adjacency list representation is easier than adjacency matrix representation.
    • (iv) All of the above
    View this question on its own page →
  6. Q1g. Level order traversal of a rooted tree can be done by starting from root and performing: - (i) Depth first search - (ii) Breadth first search - (iii) Pre-order traversal - (iv) In-order traversal20232m

    Module 4: Graph and Tree Algorithms

    Level order traversal of a rooted tree can be done by starting from root and performing:

    • (i) Depth first search
    • (ii) Breadth first search
    • (iii) Pre-order traversal
    • (iv) In-order traversal
    View this question on its own page →
  7. Q1g. The approach followed in Floyd Warshall's algorithm is - (i) Greedy approach - (ii) Dynamic approach - (iii) Backtracking - (iv) Divide and conquer20242m

    Module 4: Graph and Tree Algorithms

    The approach followed in Floyd Warshall's algorithm is

    • (i) Greedy approach
    • (ii) Dynamic approach
    • (iii) Backtracking
    • (iv) Divide and conquer
    View this question on its own page →
  8. Q1i. Which of the following algorithms are used to find the shortest path from a source node to all other nodes in a weighted graph? - (i) BFS - (ii) Prim's Algorithm - (iii) Djikstra's Algorithm - (iv) Kruskal's Algorithm20242m

    Module 4: Graph and Tree Algorithms

    Which of the following algorithms are used to find the shortest path from a source node to all other nodes in a weighted graph?

    • (i) BFS
    • (ii) Prim's Algorithm
    • (iii) Djikstra's Algorithm
    • (iv) Kruskal's Algorithm
    View this question on its own page →
  9. Q1j. The node removal of which makes a graph disconnected is called: - (i) Pendant vertex - (ii) Bridge - (iii) Articulation point - (iv) Coloured vertex20232m

    Module 4: Graph and Tree Algorithms

    The node removal of which makes a graph disconnected is called:

    • (i) Pendant vertex
    • (ii) Bridge
    • (iii) Articulation point
    • (iv) Coloured vertex
    View this question on its own page →
  10. Q4b. What is negative weight-cycle? Write Bellman-Ford algorithm to find single shortest distance of a directed graph.20237m

    Module 4: Graph and Tree Algorithms

    What is negative weight-cycle? Write Bellman-Ford algorithm to find single shortest distance of a directed graph.

    View this question on its own page →
  11. Q6. Consider the array A = \{26, 17, 41, 14, 21, 30, 47, 10, 16, 19, 21, 28, 38, 7, 12, 14, 20, 35, 39, 3\}. Create binary search tree with one more attribute its size of node. Retrieve 17th smallest element in the tree and rank the 12th element.201914m

    Module 4: Graph and Tree Algorithms

    Consider the array A={26,17,41,14,21,30,47,10,16,19,21,28,38,7,12,14,20,35,39,3}A = \{26, 17, 41, 14, 21, 30, 47, 10, 16, 19, 21, 28, 38, 7, 12, 14, 20, 35, 39, 3\}. Create binary search tree with one more attribute its size of node. Retrieve 17th smallest element in the tree and rank the 12th element.

    View this question on its own page →
  12. Q7. You are given a graph containing n vertices and m edges and given that the graph doesn't contain cycle of odd length. What is the time complexity of the best known algorithm to find out whether the graph is bipartite or not?202214m

    Module 4: Graph and Tree Algorithms

    You are given a graph containing nn vertices and mm edges and given that the graph doesn't contain cycle of odd length. What is the time complexity of the best known algorithm to find out whether the graph is bipartite or not?

    View this question on its own page →
  13. Q7b. Solve the single source shortest path problem for the following graph considering '1' as the source vertex using Dijkstra's algorithm. (Graph image reference in source document)20237m

    Module 4: Graph and Tree Algorithms

    Solve the single source shortest path problem for the following graph considering '1' as the source vertex using Dijkstra's algorithm. (Graph image reference in source document)

    View this question on its own page →
  14. Q8a. Apply single source shortest path algorithm for the following graph ![image](https://res.cloudinary.com/djkpavwmp/image/upload/v1765717027/portfolio_assets/gun2swpnorppcwi0wt3v.png)20247m

    Module 4: Graph and Tree Algorithms

    Apply single source shortest path algorithm for the following graph image

    View this question on its own page →
  15. Q8e. Explain the max-flow min-cut theorem with an example.20236m

    Module 4: Graph and Tree Algorithms

    Explain the max-flow min-cut theorem with an example.

    View this question on its own page →
  16. Q9b. Write short notes on: Topological sorting20247m

    Module 4: Graph and Tree Algorithms

    Write short notes on: Topological sorting

    View this question on its own page →