GATE CS 2021 (Afternoon) — Question 26

AlgorithmsGraph Traversals (BFS, DFS) & Single-Source Shortest PathsNAT1 markEasy

Consider a complete binary tree with 7 nodes. Let \(A\) denote the set of first 3 elements obtained by performing Breadth-First Search (BFS) starting from the root. Let \(B\) denote the set of first 3 elements obtained by performing Depth-First Search (DFS) starting from the root. The value of \(|A - B|\) is _________.
Practise the full 2021-AN paper
Challenge a friend: WhatsApp Telegram
Recommended book · affiliate linkIntroduction to Algorithms (CLRS)The standard reference behind most GATE algorithm questions.
Practise more on Graph Traversals (BFS, DFS) & Single-Source Shortest PathsTimed, in the real exam interface · free to start

A GATE question every morning

One real past-paper question every morning for your branch, answer hidden until you tap. Free on Telegram.

Join
Stuck? Ask in the student group