Consider a complete binary tree with 7 nodes. Let denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let denote the set of first 3 elements obtained by performing Depth-First Search (DFS) starting from the root. The value of is _________.
GATE CS 2021 (Afternoon) — Question 26
AlgorithmsGraph Traversals (BFS, DFS) & Single-Source Shortest PathsNAT1 markEasy
A GATE question every morning
One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.
More on Graph Traversals (BFS, DFS) & Single-Source Shortest Paths
- GATE CS 2026 (Forenoon) · Q41Let G(V, E) be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that…
- GATE CS 2026 (Forenoon) · Q50Consider the following pseudocode for depth-first search (DFS) algorithm which takes a directed graph G(V, E) as input, where d[v] and f[v]…
- GATE CS 2026 (Afternoon) · Q37Let G be a weighted directed acyclic graph with m edges and n vertices. Given G and a source vertex s in G , which one of the following opt…
- GATE CS 2025 (Afternoon) · Q29Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph G is/are…
- GATE CS 2025 (Afternoon) · Q59Consider the following algorithm someAlgo that takes an undirected graph G as input. someAlgo(G) 1. Let v be any vertex in G . Run BFS on G…
- GATE CS 2024 (Forenoon) · Q45Let G be a directed graph and T a depth first search (DFS) spanning tree in G that is rooted at a vertex v . Suppose T is also a breadth fi…

