Search
Question: Which algorithm is best suited for finding connected components in a graph?Options: BFSDFS..
Question: Which of the following is a disadvantage of DFS?Options: It can get stuck in deep paths.It..
Question: What is the primary data structure used in DFS?Options: ArrayStackQueueLinked ListCorrect ..
Question: In a graph, which traversal method uses a queue data structure?Options: DFSBFSBoth DFS and..
Question: Which algorithm would you use to find the shortest path in a weighted graph?Options: BFSDF..
Question: In a graph with V vertices and E edges, what is the time complexity of DFS?Options: O(V)O(..
Question: Which of the following is NOT a characteristic of BFS?Options: Uses a queueFinds the short..
Question: What is the primary difference between BFS and DFS in terms of traversal strategy?Options:..
Question: Which traversal method is typically used for finding connected components in an undirected..
Question: What is the space complexity of Depth-First Search (DFS) in the worst case?Options: O(V)O(..
Question: In which scenario is Breadth-First Search (BFS) preferred over Depth-First Search (DFS)?Op..
Question: Which algorithm is typically used for topological sorting?Options: BFSDFSBothNoneCorrect A..
Question: Which traversal method is more suitable for searching deep trees?Options: BFSDFSBoth are e..
Question: What is the space complexity of DFS using recursion?Options: O(V)O(E)O(V + E)O(1)Correct A..
Question: Which traversal method is guaranteed to find the shortest path in a weighted graph?Options..
Question: What is the primary application of DFS in graph theory?Options: Finding shortest pathsTopo..
Question: Which algorithm is better for finding connected components in a graph?Options: BFSDFSBoth ..
Question: Which of the following is true about BFS?Options: It uses a stackIt finds the shortest pat..
Question: What is the worst-case time complexity of DFS on a graph?Options: O(V + E)O(V^2)O(E)O(V)Co..
Question: Which traversal method is generally faster for large graphs?Options: BFSDFSBoth are equalD..
Question: If a graph has a cycle, which traversal method can detect it?Options: Only BFSOnly DFSBoth..
Question: What is the space complexity of DFS using a recursive approach?Options: O(V)O(E)O(V + E)O(..
Question: What is the worst-case time complexity of DFS for a graph represented as an adjacency matr..
Question: In which scenario would DFS be preferred over BFS?Options: Finding the shortest pathExplor..
Question: What is the space complexity of BFS using an adjacency list representation?Options: O(V)O(..
Question: Which traversal method is more memory efficient for a sparse graph?Options: BFSDFSBoth are..
Question: In DFS, what is the maximum depth of recursion for a graph with V vertices?Options: O(V)O(..
Question: If a graph is represented using an adjacency matrix, what is the time complexity of BFS?Op..
Question: What is the primary disadvantage of using DFS?Options: It cannot handle cyclesIt may get s..
Question: Which traversal method is guaranteed to visit all vertices in a connected graph?Options: B..