Data Structures & AlgorithmsModerateGATE CS · Product-company placement
The connected undirected graph with edges A–C, A–F, B–C, B–D, B–G, B–H, C–D, C–F, D–E, D–G, F–H, G–H must be walked so that every edge is traversed at least once, starting and ending at the same vertex. If repeated traversals are allowed, what is the minimum number of edges that must be added (duplicated) to make an Euler circuit possible, assuming every pair of odd vertices can be joined by a new edge?
- A. 4
- B. 1
- C. 2
- D. 3
Correct answer: C. 2
Euler circuit ⇔ connected and every degree even. There are 4 odd-degree vertices; each added edge fixes two of them, so 2 edges are needed.
Practise more Trees, Graphs, Recursion and Dynamic Programming questionsTrees, Graphs, Recursion and Dynamic Programming: notes and key points
More Trees, Graphs, Recursion and Dynamic Programming questions
- DFS on the directed graph with adjacency lists A: CDG; B: –; C: –; D: BCF; E: –; F: CE; G: CE starts at A (scanning lists in the order…
- What is the length of the longest BITONIC subsequence (strictly increasing then strictly decreasing; either part may be empty) of [19, 10…
- Keys 32, 44, 47, 53, 93, 54, 12, 22, 68, 97 are inserted into an empty AVL tree (giving preorder 53, 44, 22, 12, 32, 47, 68, 54, 93, 97)…
- Using parts 3, 4, 5 (each any number of times), in how many ways can 10 be written as an ORDERED sum (so 1 + 2 and 2 + 1 count separately)?
- The boolean expression T ^ F | T & T (T = true, F = false, & = AND, | = OR, ^ = XOR) can be fully parenthesised in 5 ways. In how many of…
- Coins of denominations 1, 3, 6, 8 are available in unlimited supply. What is the minimum number of coins needed to make 28, and how many…