GATE / CS ARCHIVE

SUBJECT COLLECTION

Discrete Mathematics · Trees & Connectivity

25 questions, newest first

GATE CSE has asked 25 questions on Trees & Connectivity (Discrete Mathematics) from 1992 to 2026, in 21 of the 46 papers; the most recent is in GATE CSE 2026 Set 2. In the last five years it carried 0.9 marks per 100-mark paper on average, against 0.5 since 2003. Since 2014 the questions have been 4 MCQ, 3 NAT and 1 MSQ. 3 groups of questions here are solved the same way; “One per method” keeps the newest of each.

Browse topics
2 marks · MCQ
Report issue

Edge-disjoint spanning trees and Jaccard similarity

Trees & Connectivity

Question 36, GATE 2026: For the complete graph K_n with n>4, represent spanning trees by their edge sets. Jaccard similarity is |T1∩T2|/|T1∪T2|. Find the minimum possible value: A 1/n; B 1/(2n−3); C 0; D 1/(n−1).
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Givens and goal

For the complete graph Kn with n>4, represent spanning trees by their edge sets. Jaccard similarity is |T1∩T2|/|T1∪T2|. Find the minimum possible value: A 1/n; B 1/(2n−3); C 0; D 1/(n−1).

Approach

Prove a lower bound and construct two trees attaining it.

Step-by-step solution

1. Cardinalities are nonnegative and the union of spanning trees is nonempty, so Jaccard similarity cannot be below 0. To attain 0 we need trees sharing no edge.
2. Label vertices 1,…,n. Choose T1 as the path 1−2−3−…−n, with edge set {(i,i+1):1≤i<n}. It is connected and has n−1 edges.
3. Choose T2 with edges {(1,j):3≤j≤n} together with (2,4). Vertices 1,3,…,n are connected through vertex 1, and vertex 2 joins through 4. There are (n−2)+1=n−1 edges; a connected graph on n vertices with n−1 edges is a tree.
4. No edge (1,j) for j≥3 is a consecutive-vertex edge of T1, and (2,4) is not consecutive either. Thus the two edge sets are disjoint, although they have the same vertex set.
5. The intersection has size 0 and the union size 2n−2, giving 0/(2n−2)=0. This attains the lower bound, so C. The completeness of Kn guarantees all constructed edges exist.

Original paper, page 24 · Answer key

1 mark · NAT
Report issue

Count all labelled spanning trees of K4

Trees & Connectivity

Question 34, GATE 2024: How many spanning trees does the complete graph on four labelled vertices A, B, C and D have?
Tap to enlarge
Answer & solution

Official answer: 16

Approach: A spanning tree uses all vertices, is connected and has no cycle. Since the graph is complete, every labelled tree on these vertices is available.
1. Cayley's formula states that the complete graph Kn has nn−2 labelled spanning trees. Substituting n=4 gives 4²=16.
2. We can verify this without the formula by classifying four-vertex tree shapes. A tree has three edges. It is either a star with one vertex of degree 3 or a path with degrees 1,2,2,1.
3. There are four stars, one for each choice of centre. For a path, arrange all four labels in an order. Reversing the order describes the same undirected path, so there are 4!/2=12 paths.
4. These shapes are disjoint and exhaustive, giving 4+12=16.
Answer: 16. Counting arbitrary three-edge subsets would also include disconnected or cyclic selections, so not every such subset is a spanning tree.

Original paper, page 21 · Answer key

2 marks · MSQ
Report issue

Infer cycle-edge parity from all spanning trees

Trees & Connectivity

Question 51, GATE 2024: A connected undirected graph has positive integer edge weights and every spanning tree has even total weight. What must hold? A all edges even; B all edges share one parity; C every cycle has only even edges; D within each cycle all its edges share one parity.
Tap to enlarge
Select all that apply
Answer & solution

Official answer: D

Approach: Exchange one cycle edge in a spanning tree and compare the two total weights modulo two.

1. Derivation. Fix a cycle C and an edge e on it. The path C minus e is acyclic and can be extended to a spanning tree T. For any other cycle edge f, T−f+e is another spanning tree. Both tree weights are even, so w(e)−w(f) is even. Thus every pair of cycle edges has the same parity, proving D. A and B fail for a graph that is itself a tree with edge weights 1, 1, 2: its only spanning tree has even total 4 but mixed parity. C fails for a triangle with all three weights 1, whose spanning trees all weigh2 although its cycle edges are odd.

2. Explanation and checks. The extension step is justified because any acyclic edge set in a connected graph can be extended to a spanning tree by repeatedly joining components. Adding e to the tree containing C−e creates exactly the cycle C, so removing any f in that cycle returns a tree. Equal parity of tree sums forces equal parity of e and f. Bridges do not belong to cycles, explaining why D places no restriction on their individual parity and why global uniform parity need not follow.

Original paper, page 36 · Answer key

2 marks · NAT
Report issue

Trees & Connectivity

Question 58, GATE 2022: Directed graph on {1,2,3,4,5} has edge i→j exactly when 1≤j≤i≤5. Count directed spanning trees rooted at 5 with directed paths from 5 to every vertex and an undirected underlying tree.
Tap to enlarge
Answer & solution

Official answer: 24

An edge goes only from a larger label to a smaller label, apart from irrelevant self-loops. Every nonroot vertex j in an outward tree must choose exactly one incoming edge from a parent in {j+1,..., 5}. There are respectively 4, 3, 2, 1 choices for j=1, 2, 3, 4. Any such choices form a tree rooted at 5: following parents strictly increases the label and must end at 5, so there are no cycles and every vertex is reached. The total is 4*3*2*1=24.

Self-loops cannot be in a spanning tree. Each nonroot has indegree exactly one in an outward arborescence, so choosing its parent is necessary, not merely sufficient. Exactly four nonloop edges are selected; increasing parent labels ensure all parent chains terminate at the sole root 5 rather than another component.

Original paper, page 39 · Answer key

1 mark · NAT
Report issue

Trees & Connectivity

Question 20, GATE 2017: T is a tree with 10 vertices. Find the sum of degrees of all vertices.
Tap to enlarge
Answer & solution

Official answer: 18.0

Our answer: 18

1. A finite undirected tree is connected and acyclic. Its edge count is number of vertices minus one, so this tree has 10−1=9 edges.

2. Sum the degrees by counting edge ends: every edge contributes exactly one to each of its two endpoints. Hence Σdeg(v)=2|E|.

3. The result is 2×9=18. This does not depend on whether the tree is a path, star, or another shape.

Original paper, page 10 · Answer key

2 marks · MCQ
Report issue

Trees & Connectivity

Question 62, GATE 2015: A bridge is an edge whose removal disconnects a connected graph. Which assertion is true? A a tree has no bridges; B a bridge cannot lie on a simple cycle; C every edge of a clique of size at least 3 is a bridge; D a graph with bridges cannot contain a cycle.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

If an edge lies on a simple cycle, the rest of that cycle still connects its endpoints after removal, so it cannot disconnect a connected graph. Therefore a bridge cannot lie on a simple cycle, B. Every edge of a nontrivial tree is a bridge, and attaching a leaf to a triangle gives a graph with both a bridge and a cycle.

If an edge lies on a cycle, removing it leaves the rest of that cycle as an alternate path between its endpoints. It therefore cannot disconnect the graph, proving B. Every edge of a nontrivial tree is a bridge, refuting A. Clique edges with at least three vertices lie in triangles, refuting C. A triangle with a single pendant edge has both a cycle and a bridge, refuting D. These examples separate a property of one edge from a property of the entire graph.

Original paper, page 50 · Answer key

1 mark · MCQ
Report issue

Trees & Connectivity

Question 3, GATE 2014: For directed G=(V,E), which construction preserves its strongly connected components? A: Keep V and use every ordered pair not in E. B: Keep V and reverse all edges: E₂={(u,v):(v,u)∈E}. C: Keep V and add an edge (u,v) whenever G has a path from u to v of length at most 2. D: Keep E but remove isolated vertices from V. The paper asks for one option.
Tap to enlarge
Your answer
Answer & solution

Official answer: B

Our answer: B and C

1. Method and setup. An SCC is an equivalence class under mutual reachability, so compare reachability rather than individual edges. Reversing paths preserves mutual reachability. Also, shortening existing paths into edges cannot introduce reachability that was absent, while retaining all length-one edges preserves old paths.

2. Work through the result and its assumptions. Reversing every edge reverses paths and preserves mutual reachability, so B preserves every SCC. C also preserves them: it includes every original length 1 edge, and every added edge abbreviates an original path of length≤2. Thus reachability in either graph is equivalent. The official single answer B omits the equally valid C. Deleting isolated vertices loses singleton SCCs; complementing edges need not preserve SCCs.

Original paper, page 8 · Answer key

2 marks · MCQ
Report issue

Trees & Connectivity

Question 51, GATE 2014: A forest G has n vertices and k connected components. How many edges does it contain? A floor(n/k); B ceil(n/k); C n−k; D n−k+1.
Tap to enlarge
Your answer
Answer & solution

Official answer: C

Step 1: Each connected component of a forest is a tree. A tree with vi vertices contains vi−1 edges, including a one-vertex component with zero edges. Step 2: Sum across the k components: E=Σ(vi−1)=Σvi−k=n−k. Step 3: Thus C is correct. The quotient n/k concerns an average component size, not the total edge count; the extra +1 in D would already fail for a single tree.

Original paper, page 65 · Answer key

1 mark · MCQ
Report issue

Degree sum of two trees

Trees & Connectivity

Question 1, GATE 2010: For a graph G=(V,E), define ξ(G)=Σ_d i_d·d, where i_d is the number of vertices of degree d. S and T are two different trees satisfying ξ(S)=ξ(T). Which relation holds between their numbers of vertices |S| and |T|?
Options: (A) |S|=2|T|; (B) |S|=|T|−1; (C) |S|=|T|; (D) |S|=|T|+1.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

The defined sum counts every vertex degree and hence equals 2|E| by the handshake lemma. A tree with v vertices has v−1 edges, so ξ=2(v−1). Equal ξ for S and T implies equal vertex counts |S|=|T|, C; the trees need not be isomorphic.

Why the degree sum works: each edge has two endpoints, so contributes exactly two to Σ_d id d. Writing s=|S| and t=|T| gives 2(s−1)=2(t−1), hence s=t. “Different” need not mean different sizes: two nonisomorphic trees can have the same vertex count and therefore the same degree sum.

Original paper, page 2

2 marks · MCQ
Report issue

Two edge-disjoint spanning trees and connectivity

Trees & Connectivity

Question 42, GATE 2008: A graph G has n vertices and 2n−2 edges partitionable into two edge-disjoint spanning trees. Which statement is NOT true?

(A) Every induced subgraph on k vertices has at most 2k−2 edges
(B) The minimum cut has at least two edges
(C) Every pair of vertices has two edge-disjoint paths
(D) Every pair of vertices has two internally vertex-disjoint paths
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

1. The claim about two internally vertex-disjoint paths is not guaranteed. Take two copies of K4 sharing exactly one vertex: n=7 and m=12=2n−2. Each K4 decomposes into two spanning trees (for example a path on its four vertices and its complementary path); joining corresponding trees at the shared vertex gives two edge-disjoint spanning trees of the whole graph.
2. The common vertex is nevertheless an articulation vertex, so paths between the two sides must share it. A is true because each tree induces a forest with at most k−1 edges on a nonempty k-vertex set. B is true since each spanning tree contributes a distinct edge across every nontrivial cut.
3. C follows by taking the unique path in each of the two edge-disjoint trees.

Original paper, page 7

2 marks · MCQ
Report issue

Connected components of intersection graph

Trees & Connectivity

Question 73, GATE 2006: A simple undirected graph G has one vertex for each of the 2^n subsets of an n-element set, n≥6. Two distinct vertices are adjacent iff their subsets intersect in exactly two elements. How many connected components are there?
Options:
(A) n
(B) n+2
(C) 2^(n/2)
(D) 2^n/n
Question 73, GATE 2006: A simple undirected graph G has one vertex for each of the 2^n subsets of an n-element set, n≥6. Two distinct vertices are adjacent iff their subsets intersect in exactly two elements. How many connected components are there?
Options:
(A) n
(B) n+2
(C) 2^(n/2)
(D) 2^n/n
Tap to enlarge
Your answer
Answer & solution

Answer: B (no official key was published)

1. There are n+1 isolated vertices from Q71. All vertices of size at least two are in one additional component.

2. Any larger set S is adjacent to a two-element subset T⊂S. Any two distinct two-element subsets T,U are both adjacent to their union T∪U, since its intersection with each is that two-element subset.

3. Hence all nonisolated vertices are connected. Total components=n+1+1=n+2, B.

4. Teaching check: Connectivity does not require every two nonisolated vertices to be directly adjacent. Any two pairs connect through their union; every larger set attaches to one of its own pairs. These short paths prove there is exactly one component besides the n+1 isolated vertices.

Original paper, page 11

1 mark · MCQ
Report issue

Spanning trees of a complete unit graph

Trees & Connectivity

Question 6, GATE 2005: An undirected n-vertex graph has adjacency matrix with zero diagonal and all other entries 1. Which MST claim? A none; B unique with cost n−1; C multiple distinct MSTs each cost n−1; D multiple spanning trees with differing costs. The n≥3 assumption for C is not explicitly printed.
Tap to enlarge
Your answer
Answer & solution

Answer: C for n≥3 (no official key was published)

The adjacency matrix describes Kn with unit edge weights. Every spanning tree has n−1 edges and therefore cost n−1. For n≥3 there are multiple spanning trees (indeed nn−2), giving C. The prompt does not restrict n: K1 and K2 each have a unique spanning tree, so the multiple-tree assertion requires the nontrivial n≥3 convention.

The matrix describes a complete graph Kn. Interpreting all edges with unit weight, any spanning tree has n−1 edges and thus equal cost n−1. When n≥3, different trees exist, so C is intended. But n=1 or 2 gives a unique tree, which is why the unprinted size restriction must stay explicit. Neither a different tree shape nor a different traversal order changes total cost here.

Original paper, page 1

1 mark · MCQ
Report issue

Components after deleting a vertex

Trees & Connectivity

Question 8, GATE 2003: An arbitrary graph has n vertices and k connected components. After deleting one vertex and its incident edges, between which bounds must the new component count lie? A. k and n; B. k−1 and k+1; C. k−1 and n−1; D. k+1 and n−k.
Tap to enlarge
Your answer
Answer & solution

Answer: C (no official key was published)

1. To see why k is not a valid lower bound, delete an isolated vertex. To see why k+1 is not a valid upper bound, delete the center of a large star, leaving many isolated leaves. In every case the k−1 untouched components remain and the n−1 remaining vertices bound the total above.

2. Only the deleted vertex’s original component can change. If it is an isolated vertex, the component count decreases to k−1; otherwise that component can split but the other k−1 remain. At most n−1 components can exist on the remaining n−1 vertices. Thus the necessary bounds are k−1 and n−1, C.

Original paper, page 1

2 marks · MCQ
Report issue

Leaves in a full ternary tree

Trees & Connectivity

Question 2.9, GATE 2002: A rooted tree has n nodes, each with either zero or three children. How many leaves does it have?
(A) n/2; (B) (n−1)/3; (C) (n−1)/2; (D) (2n+1)/3.
Tap to enlarge
Your answer
Answer & solution

Answer: D (no official key was published)

Step 1: Count edges in two ways.

Step 2: Every vertex except the root has exactly one parent edge, so there are n−1 edges. Every internal node has three children, so there are 3I edges. Equating gives I=(n−1)/3. Subtracting internal nodes from all nodes gives leaves L=n−(n−1)/3=(2n+1)/3. For the smallest nontrivial case n=4, this correctly returns three leaves.

Conclusion: Let I be the internal-node count and L the leaves. Each internal node supplies 3 child edges, while a tree has n−1 edges, so 3I=n−1. Hence L=n−I=(2n+1)/3, D, for n admitting such a tree.

Original paper, page 4

Descriptive
Report issue

Parity components of the subset graph

Trees & Connectivity

Question 6(b), GATE 2000: G has one vertex for each of the 2ⁿ subsets of S={1,…,n}. Vertices A,B are adjacent iff |A△B|=2, where △ is symmetric difference.

Task: Find the number of connected components.
Question 6(b), GATE 2000: G has one vertex for each of the 2ⁿ subsets of S={1,…,n}. Vertices A,B are adjacent iff |A△B|=2, where △ is symmetric difference.

Task: Find the number of connected components.
Tap to enlarge
Shared context

G has one vertex for each of the 2ⁿ subsets of S={1,…,n}. Vertices A,B are adjacent iff |A△B|=2, where △ is symmetric difference.

Answer & solution

Answer: Two for n≥1: even-cardinality and odd-cardinality subsets; one if n=0. (no official key was published)

1. Toggling two memberships changes cardinality by −2, 0 or +2. Its parity cannot change, so no path joins an even subset to an odd subset.

2. Conversely, if A and B have the same parity, their symmetric difference has even size. Partition A△B into pairs P₁,…,Pₖ and successively toggle these pairs.

3. Every toggle is a legal edge and after k toggles the vertex is A△(A△B)=B. Thus each parity class is connected.

4. Both parity classes are nonempty when n≥1, giving exactly two components. When n=1 these are two isolated vertices. If the degenerate case n=0 is allowed, the graph has only ∅ and hence one component.

Original paper, page 7

1 mark · MCQ
Report issue

Articulation points in two joined triangles

Trees & Connectivity

Question 1.15, GATE 1999: The graph has edges 12,13,23,24,35,36,56,57. How many articulation vertices: 0,1,2,3?
Question 1.15, GATE 1999: The graph has edges 12,13,23,24,35,36,56,57. How many articulation vertices: 0,1,2,3?
Tap to enlarge
Your answer
Answer & solution

Answer: D: 3 (no official key was published)

Removing vertex 2 isolates leaf 4. Removing vertex 3 separates the triangle on 1,2 from the triangle on 5,6. Removing vertex 5 isolates leaf 7. Therefore 2,3,5 are articulation points. Removing either leaf does not disconnect the remaining graph, and removing 1 or 6 leaves the corresponding triangle connected through its other edge. No other vertex qualifies, so the count is three, D. The edge list is a self-contained transcription of the linked diagram.

Original paper, page 2

Report issue

First proposed edge cut

Trees & Connectivity

Question 5(a)(i), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {AB,EF,BD,AE,AD} a cut?
Question 5(a)(i), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {AB,EF,BD,AE,AD} a cut?
Question 5(a)(i), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {AB,EF,BD,AE,AD} a cut?
Question 5(a)(i), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {AB,EF,BD,AE,AD} a cut?
Tap to enlarge
Shared context

G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {AB,EF,BD,AE,AD} a cut?

Answer & solution

Answer: No; the remaining graph is connected. (no official key was published)

After deleting the proposed five edges, the remaining edges are AF, BC, CF, DE, and DF. They form a connected spanning tree: B–C–F–D–E is a path and A attaches to F. In particular, starting at F reaches A and C directly, B through C, D directly, and E through D. Therefore no vertex is separated, and the proposed set is not a cut. Removing many edges does not by itself guarantee disconnection; one must check connectivity of the surviving graph.

Original paper, page 6

Report issue

Second proposed edge cut

Trees & Connectivity

Question 5(a)(ii), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {BD,CF,AB} a cut?
Question 5(a)(ii), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {BD,CF,AB} a cut?
Question 5(a)(ii), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {BD,CF,AB} a cut?
Question 5(a)(ii), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {BD,CF,AB} a cut?
Tap to enlarge
Shared context

G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Is {BD,CF,AB} a cut?

Answer & solution

Answer: Yes; it separates {B,C} from {A,D,E,F}. (no official key was published)

The only edges crossing between {B,C} and the remaining vertices are BA, BD, and CF. All three are removed. The edge BC survives, leaving B and C connected to one another but with no path to the other four vertices. The induced remaining subgraph on {A,D,E,F} is connected, for example by AD, DE, and EF. Consequently the deletion produces exactly two components and is a cut. Its size is three, although it is not a minimum cut.

Original paper, page 6

2 marks · Descriptive
Report issue

Minimum cut of the six-vertex graph

Trees & Connectivity

Question 5(b), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Find the min-cut cardinality.
Question 5(b), GATE 1999: G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Find the min-cut cardinality.
Tap to enlarge
Shared context

G is the undirected graph on {A,B,C,D,E,F} with edges {AB,AD,AE,AF,BC,BD,CF,DE,DF,EF}. Edge crossings without a labeled vertex are not vertices. A cut is any edge set whose removal disconnects G; a min-cut has minimum cardinality. Find the min-cut cardinality.

Answer & solution

Answer: 2, witnessed by removing BC and CF to isolate C. (no official key was published)

An upper bound is immediate: C has degree two, so deleting BC and CF isolates C. Hence the minimum cut has size at most two.

To exclude a one-edge cut, show that no edge is a bridge. The cycle A–B–C–F–A contains AB, BC, CF, AF. The triangle A–B–D–A contains BD and AD. The triangle A–D–E–A contains DE and AE. Finally the triangle D–E–F–D contains EF and DF. Together these cycles cover every edge of G.

An edge on a cycle cannot be a bridge because the rest of that cycle provides an alternate path between its endpoints after deletion. The graph is connected initially, so a zero-edge cut is impossible. Therefore its minimum cut cardinality is exactly two.

Original paper, page 6

2 marks · Descriptive
Report issue

Edge lower bound from edge connectivity

Trees & Connectivity

Question 5(c), GATE 1999: Let G be a connected undirected graph with n≥2 vertices and min-cut cardinality k. Prove G has at least nk/2 edges.
Question 5(c), GATE 1999: Let G be a connected undirected graph with n≥2 vertices and min-cut cardinality k. Prove G has at least nk/2 edges.
Tap to enlarge
Shared context

Let G be a connected undirected graph with n≥2 vertices and min-cut cardinality k. Prove G has at least nk/2 edges.

Answer & solution

Answer: 2|E|=Σᵥdeg(v)≥nk, so |E|≥nk/2. (no official key was published)

For each vertex v, delete all edges incident to v. This isolates v from the other n−1 vertices, so those deg(v) edges form a cut. Since k is the minimum possible cut size, deg(v)≥k for every v.

Sum these n inequalities to obtain Σᵥdeg(v)≥nk. By the handshake lemma, every undirected edge contributes one to each endpoint degree, and therefore Σᵥdeg(v)=2|E|. Dividing by two gives |E|≥nk/2. If nk is odd, the integer edge count is in fact at least ⌈nk/2⌉. The proof explains why the minimum cut bounds every degree rather than merely the average degree.

Original paper, page 6

2 marks · MCQ
Report issue

Leaves in a full n-ary tree

Trees & Connectivity

Question 2.11, GATE 1998: Every node has either 0 or n children. If x nodes are internal, how many leaves are there?
Tap to enlarge
Your answer
Answer & solution

Answer: A: x (n−1)+1 (no official key was published)

Each internal node contributes exactly n child edges, so the tree has nx edges. If it has L leaves, its total vertices are x+L, and any tree has one fewer edge than vertices: nx=x+L−1. Rearranging yields L=x (n−1)+1, A. The explicit 0-or-n condition is essential; it prevents one-child or partially populated internal nodes from invalidating the count. For x=0 it correctly gives a single root leaf.

Original paper, page 4

2 marks · MCQ
Report issue

Components for step8 or12 edges

Trees & Connectivity

Question 6.2, GATE 1997: Vertices 1…100 are adjacent when their difference is 8 or 12. Count connected components among 8, 4, 12, 25.
Tap to enlarge
Your answer
Answer & solution

Answer: B: 4 (no official key was published)

Every allowed difference is divisible by 4, so a path preserves residue modulo 4. There are at least four components. Each residue class contains 25 vertices; after rescaling by 4, its edges connect indices differing by 2 or 3. These 25 indices form a connected graph: all odd indices connect by 2, all even indices connect by 2, and the edge 1–4 of difference 3 joins the two chains. Hence each residue class is one component, proving exactly four, B. The boundary argument is necessary; a gcd observation alone would only prove the lower bound for a finite interval.

Original paper, page 5

Descriptive
Report issue

Induction on full ternary trees

Trees & Connectivity

Question 5, GATE 1994: A 3-ary tree has exactly three children at every internal node. Use induction to prove that with n internal nodes it has 2(n−1)+3 leaves (GateForum). GFG instead prints 2(n−1).
Tap to enlarge
Answer & solution

Answer: The formula as printed is false; with +3 (2n+1 leaves) it holds (no official key was published)

1. Base n=1: a root with three children has three leaves, equal to 2(1−1)+3.

2. For any full ternary tree with n+1 internal nodes, choose a deepest internal node. Its three children are leaves. Prune those three children, making their parent a leaf.

3. The smaller tree has n internal nodes and, by induction, 2n+1 leaves. Restoring the three children replaces one leaf by three, increasing the leaf count by two. Thus the original has 2n+3=2((n+1)−1)+3 leaves.

4. The single-node tree n=0 also satisfies 2n+1=1 if that case is included.

  • Both say interval nodes, understood as internal nodes from the definition.

Original paper, page 5

5 marks · Descriptive
Report issue

Leaves in a full binary tree

Trees & Connectivity

Question 16, GATE 1993: Prove by mathematical induction that a binary tree in which every non-leaf node has two descendants has one more leaf than non-leaf node. Interpret descendants here as immediate children, i.e. a finite nonempty full binary tree.
Tap to enlarge
Answer & solution

Answer: L=I+1 for every finite nonempty full binary tree. (no official key was published)

Let I be the number of internal (non-leaf) nodes and L the number of leaves. We prove L=I+1 by strong induction on I for finite nonempty full binary trees.

Base case I=0: there is only the root, and it is a leaf. Thus L=1=I+1. The empty tree is excluded: it would have L=I=0 and would not satisfy the stated formula.

Inductive hypothesis: for every full binary tree with fewer than k internal nodes, the number of leaves is one more than the number of internal nodes. Consider a tree with k>=1 internal nodes. Its root is internal and, by the full-tree condition, has exactly two children. The subtrees rooted at these children are nonempty full binary trees; call their internal and leaf counts I1,L1 and I2,L2. Each Ii<k, and k=1+I1+I2. The induction hypothesis applies to both subtrees: L1=I1+1 and L2=I2+1. Their leaves are disjoint and are exactly the leaves of the original tree, since the root is not a leaf. Hence L=L1+L2=I1+I2+2=k+1. This completes the induction.

An equivalent structural induction starts with one leaf and replaces any leaf by an internal node with two new leaf children. Every such operation increases I by one and increases L by one (remove one leaf, add two), preserving L−I=1. As an independent check, a tree with I+L vertices has I+L−1 edges; counting edges by parents gives 2I, so 2I=I+L−1. The immediate-child interpretation matters: general binary trees permitting a single child need not obey the formula.

Original paper, page 12

Descriptive
Report issue

Edges in a forest

Trees & Connectivity

Question 3(iii), GATE 1992: A forest has n vertices and p connected components. How many edges?
Question 3(iii), GATE 1992: A forest has n vertices and p connected components. How many edges?
Tap to enlarge
Answer & solution

Answer: n−p (no official key was published)

Every component of a forest is a tree. If component i has ni vertices, it has ni−1 edges. Summing over the p components gives Σ(ni−1)=Σni−p=n−p. Isolated vertices count as one-vertex components with zero edges, so the formula handles them automatically. The acyclicity assumption is essential: a graph with cycles can have more edges with the same n and p. The empty forest gives zero with n=p=0.

Original paper, page 5