FliQi Education App Download
प्रश्न-बैंक · DSA

Graph — प्रश्न और उत्तर

DSA · 26 जाँचे हुए (verified) प्रश्न

  • 26 जाँचे हुए प्रश्न
  • हिंदी + English

पहले 10 प्रश्नों के उत्तर और हल यहीं खुले हैं; बाक़ी 16 के उत्तर और हल FliQi Question Bank app में।

भाषा
प्रश्न 1उत्तर + हल
n शीर्षों और e किनारों वाले अदिशात्मक (undirected) graph G में सभी शीर्षों की डिग्री का योग क्या होता है?
For an undirected graph G with n vertices and e edges, the sum of the degrees of all vertices is
  1. Ane
  2. B2n
  3. C2e
  4. Den

सही उत्तर / Answer: (C)

हल / Solution
हर किनारा (edge) ठीक दो शीर्षों को जोड़ता है, इसलिए वह दोनों शीर्षों की डिग्री में एक-एक बार गिना जाता है। इसी से सभी डिग्री का योग किनारों का दोगुना, यानी 2e हो जाता है — इसे हस्तमिलाप प्रमेयिका (handshaking lemma) कहते हैं। इसका एक नतीजा यह है कि विषम डिग्री वाले शीर्षों की संख्या हमेशा सम होती है। जाँच: n शीर्षों वाले ट्री में किनारे n − 1 होते हैं, तो डिग्री का योग 2(n − 1) निकलता है।
Every edge joins exactly two vertices, so it is counted once in the degree of each of them. That makes the sum of all degrees twice the edge count, that is 2e, a fact known as the handshaking lemma. One consequence is that the number of vertices of odd degree is always even. Check it on a tree with n vertices, which has n minus 1 edges, so the degrees there add up to 2 times n minus 1.
प्रश्न 2उत्तर + हल
{v1 … vn} पर एक weighted complete graph है, जिसमें किनारे (vi, vj) का भार 2|i − j| है। इसके न्यूनतम स्पैनिंग ट्री (MST) का भार क्या होगा?
In a weighted complete graph on {v1 … vn}, the edge (vi, vj) has weight 2|i − j|. The weight of its minimum spanning tree (MST) is
  1. An − 1
  2. B2n − 2
  3. C(n/2)
  4. Dn2

सही उत्तर / Answer: (B)

हल / Solution
सबसे सस्ते किनारे वे हैं जहाँ |i − j| = 1, यानी लगातार आने वाले शीर्षों को जोड़ने वाले किनारे; हर एक का भार 2 है। n शीर्षों के स्पैनिंग ट्री में n − 1 किनारे लगते हैं, और v1–v2, v2–v3 … वाली शृंखला सभी शीर्ष जोड़ देती है। कुल भार 2 × (n − 1) = 2n − 2 हुआ। जाँच: n = 3 पर दो किनारे, भार 4। n − 1 तब आता जब हर भार 1 होता।
The cheapest edges are those with an index gap of one, that is, edges joining consecutive vertices, and each of them weighs 2. A spanning tree over n vertices needs n minus 1 edges, and the chain v1 to v2, v2 to v3 and so on links every vertex. So the total weight is 2 times (n minus 1), which is 2n minus 2. Check with n equal to 3: two edges, weight 4.
प्रश्न 3उत्तर + हल
किसी graph में articulation point (कट शीर्ष) क्या होता है?
What is an articulation point in a graph?
  1. Aसबसे अधिक डिग्री वाला शीर्षVertex with highest degree
  2. Bवह शीर्ष जिसे हटाने पर graph टूटकर अलग हो जाता हैVertex whose removal disconnects the graph
  3. Cसबसे कम डिग्री वाला शीर्षVertex with lowest degree
  4. Dgraph का मूल (root) शीर्षRoot of the graph

सही उत्तर / Answer: (B)

हल / Solution
articulation point या कट शीर्ष (cut vertex) वह शीर्ष है जिसे और उसके किनारों को हटा देने पर जुड़ा हुआ graph दो या अधिक टुकड़ों में बँट जाता है। यह नेटवर्क की कमज़ोर कड़ी बताता है — जैसे वह router, जिसके बैठ जाने से नेटवर्क टूट जाए। इसे खोजने का तरीक़ा गहराई-पहले खोज (DFS) पर टिका है, जिसमें discovery time और low-link मान से O(V+E) समय में काम हो जाता है। डिग्री से इसका सीधा संबंध नहीं।
An articulation point, also called a cut vertex, is a vertex whose removal along with its edges splits a connected graph into two or more pieces. It marks the weak link of a network, like a router whose failure cuts the network in half. Such vertices are found by a depth first search that keeps discovery times and low-link values, in time of the order V plus E. Degree has no direct bearing on it.
प्रश्न 4उत्तर + हल
किसी graph में चाल (walk) की लंबाई होती है —
Length of the walk of a graph is
  1. Aचाल W में शीर्षों (vertices) की संख्याthe number of vertices in walk W
  2. Bचाल W में किनारों (edges) की संख्याthe number of edges in walk W
  3. Cgraph में किनारों की कुल संख्याtotal number of edges in a graph
  4. Dgraph में शीर्षों की कुल संख्याtotal number of vertices in a graph

सही उत्तर / Answer: (B)

हल / Solution
चाल (walk) की लंबाई उसमें घूमे गए किनारों (edges) की संख्या होती है। जैसे चाल A → B → C → D में तीन किनारे पार होते हैं, इसलिए लंबाई 3 है, जबकि शीर्ष चार हैं। यानी शीर्ष गिनने पर उत्तर एक ज़्यादा आ जाता है, इसलिए पहला विकल्प ग़लत है। बाक़ी दो विकल्प पूरे graph की गिनती बताते हैं — कुल शीर्ष graph का क्रम (order) है और कुल किनारे उसका आकार (size), चाल की लंबाई नहीं।
The length of a walk is the number of edges travelled along it. In the walk A to B to C to D three edges are crossed, so the length is 3, while the vertex count is four. Counting vertices gives an answer one too large, which is why the first option fails. The last two options describe the whole graph: the vertex total is its order and the edge total is its size.
प्रश्न 5उत्तर + हल
किसी चाल (walk) के पहले और अंतिम शीर्ष को छोड़कर बाक़ी सभी शीर्षों को क्या कहा जाता है?
All the vertices of a walk except the very first and the very last vertex, are called
  1. Aइंटरनल शीर्ष (internal vertices)internal vertices
  2. Bएक्सटर्नल शीर्ष (external vertices)external vertices
  3. Cइंटरमीडिएट शीर्ष (intermediate vertices)intermediate vertices
  4. Dआसन्न शीर्ष (adjacent vertices)adjacent vertices

सही उत्तर / Answer: (C)

हल / Solution
किसी चाल (walk) में दो सिरे ख़ास होते हैं — शुरू का शीर्ष और अंत का शीर्ष। इनके बीच पड़ने वाले सभी शीर्ष इंटरमीडिएट शीर्ष (intermediate vertices) कहलाते हैं। जैसे चाल A → B → C → D में B और C इंटरमीडिएट हैं। आसन्न (adjacent) का मतलब बस यह है कि दो शीर्ष एक किनारे से जुड़े हैं, चाल में उनकी जगह से कोई मतलब नहीं। internal शब्द ट्री में चलता है, पत्ती न होने वाले शीर्ष के लिए।
A walk has two special ends: the starting vertex and the finishing vertex. Every vertex lying between them is called an intermediate vertex. In the walk A to B to C to D, the vertices B and C are the intermediate ones. Adjacent means only that two vertices share an edge, which says nothing about their place in a walk. The word internal belongs to trees, where a vertex that is not a leaf is called internal.
प्रश्न 6उत्तर + हल
graph G का वह पथ (path), जिसमें G का हर शीर्ष ठीक एक बार आता है, क्या कहलाता है?
A path in graph G, which contains every vertex of G one and only once?
  1. Aयूलर टूर (Euler tour)Euler tour
  2. Bहैमिल्टनियन पथ (Hamiltonian path)Hamiltonian path
  3. Cयूलर ट्रेल (Euler trail)Euler trail
  4. Dहैमिल्टनियन टूर (Hamiltonian tour)Hamiltonian tour

सही उत्तर / Answer: (B)

हल / Solution
जिस पथ में graph का हर शीर्ष ठीक एक बार आता है, उसे हैमिल्टनियन पथ (Hamiltonian path) कहते हैं। हैमिल्टनियन टूर या परिपथ (circuit) इससे आगे की बात है — वह शुरू वाले शीर्ष पर लौट आता है, इसलिए उसमें एक शीर्ष दो बार आता है, और प्रश्न ऐसा लौटना नहीं माँग रहा। यूलर टूर और यूलर ट्रेल में गिनती किनारों (edges) की होती है, शीर्षों की नहीं — उनमें हर किनारा एक बार घूमा जाता है।
A path that contains every vertex of the graph exactly once is called a Hamiltonian path. A Hamiltonian tour, or circuit, goes one step further by returning to the starting vertex, so there one vertex appears twice, and the question asks for no such return. An Euler tour and an Euler trail are about edges rather than vertices: in them every edge is covered once, while a vertex may well be visited again.
प्रश्न 7उत्तर + हल
पूर्ण graph Kn में ......... भिन्न स्पैनिंग ट्री (spanning trees) होते हैं।
The complete graph Kn has .......... different spanning trees.
  1. Ann−2
  2. Bn × n
  3. Cnn
  4. Dn2

सही उत्तर / Answer: (A)

हल / Solution
पूर्ण graph में स्पैनिंग ट्री गिनने के लिए केली का सूत्र (Cayley's formula) है — Kn में nn−2 भिन्न स्पैनिंग ट्री होते हैं। जाँच कीजिए: n = 3 पर 31 = 3, और त्रिभुज में सचमुच तीन ही स्पैनिंग ट्री बनते हैं, क्योंकि हर बार एक किनारा हटाना पड़ता है। n = 4 पर 42 = 16 मिलते हैं। बाक़ी विकल्प इसी जाँच पर गिर जाते हैं — n = 3 पर वे 9, 27 और 9 बताते हैं।
Spanning trees of a complete graph are counted by Cayley's formula: Kn has n to the power n minus 2 of them. Check it with n equal to 3, which gives 3, and a triangle really has just three spanning trees, since one edge has to be dropped each time. For n equal to 4 the formula gives 16. The other choices fail the same check, because at n equal to 3 they would give 9, 27 and 9 instead.
प्रश्न 8उत्तर + हल
n शीर्षों वाले पूर्ण graph (complete graph) में किनारों की कुल संख्या होती है —
The total number of edges in a complete graph of n vertices is
  1. An
  2. Bn2/2
  3. Cn(n + 1)/2
  4. Dn(n − 1)/2

सही उत्तर / Answer: (D)

हल / Solution
पूर्ण graph (complete graph) में हर शीर्ष बाक़ी हर शीर्ष से जुड़ा होता है, इसलिए हर शीर्ष की डिग्री n − 1 होती है। सभी डिग्री का योग n(n − 1) हुआ, और वह योग किनारों का दोगुना होता है। इसलिए किनारे = n(n − 1)/2। जाँच: K4 में 4 × 3/2 = 6 किनारे, जो सही है। n(n + 1)/2 लिखने पर हर शीर्ष का अपने से भी जोड़ गिन लिया जाता, और n2/2 पूर्णांक भी नहीं देता।
In a complete graph every vertex is joined to every other vertex, so each vertex has degree n minus 1. The degrees add up to n(n minus 1), and that sum is twice the number of edges. Hence the edge count is n(n minus 1)/2. Check it on K4: 4 times 3 divided by 2 gives 6 edges, which is right. The form with n plus 1 would also count a loop at each vertex.
प्रश्न 9उत्तर + हल
एक जुड़ा हुआ graph G आयलर graph (Euler graph) तभी होता है जब G के सभी शीर्षों की डिग्री हो —
A connected graph G is a Euler graph if and only if all vertices of G are of
  1. Aसमान डिग्री (same degree)same degree
  2. Bसम डिग्री (even degree)even degree
  3. Cविषम डिग्री (odd degree)odd degree
  4. Dभिन्न डिग्री (different degree)different degree

सही उत्तर / Answer: (B)

हल / Solution
आयलर graph में एक ही बंद चाल (closed walk) से हर किनारा ठीक एक बार घूम लिया जाता है। हर शीर्ष में जितनी बार घुसा जाता है उतनी ही बार निकलना पड़ता है, इसलिए किनारे जोड़े में बँटते हैं और हर शीर्ष की डिग्री सम (even) होनी चाहिए। graph जुड़ा हुआ भी हो, यह दूसरी शर्त है। डिग्री समान होना ज़रूरी नहीं — 2 और 4 मिलकर भी चल जाता है। विषम डिग्री मिलते ही बंद चाल टूटती है।
In an Euler graph one closed walk covers every edge exactly once. At each vertex you must leave as often as you enter, so the edges there pair up and the degree of every vertex has to be even. The graph must also be connected, which is the second condition. The degrees need not be equal: a mix of 2 and 4 works fine. One vertex of odd degree breaks the closed walk.
प्रश्न 10उत्तर + हल
graph को घूमने (graph traversal) की विधि है —
Method of graph traversal is
  1. Aगहराई-पहले खोज (depth first search)depth first search
  2. Bचौड़ाई-पहले खोज (breadth first search)breadth first search
  3. C(a) और (b) दोनोंBoth (a) and (b)
  4. Dलंबाई-पहले खोज (length first search)length first search

सही उत्तर / Answer: (C)

हल / Solution
graph को घूमने की दो मानक विधियाँ हैं — गहराई-पहले खोज (depth first search, DFS) और चौड़ाई-पहले खोज (breadth first search, BFS)। DFS एक रास्ते पर जहाँ तक जा सके जाती है, फिर पीछे लौटती है, और इसमें स्टैक लगता है। BFS स्तर-दर-स्तर चलती है और उसमें क्यू लगती है। दोनों ही विधियाँ हैं, इसलिए अकेला (a) या अकेला (b) अधूरा उत्तर है। 'लंबाई-पहले खोज' नाम की कोई विधि होती ही नहीं, वह गढ़ा हुआ विकल्प है।
A graph is traversed by two standard methods: depth first search and breadth first search. Depth first search goes as far along one route as it can and then backs up, and it uses a stack. Breadth first search moves level by level and uses a queue. Since both are genuine methods, picking only (a) or only (b) leaves the answer half done. There is no method called length first search, so that option is simply invented.
आगे के 16 प्रश्नों के उत्तर और हल app मेंFliQi Question Bank — अभ्यास, हल और आपकी प्रगति
App खोलिए
प्रश्न 11उत्तर app में
किसी graph को चौड़ाई-पहले खोज (breadth first search) से घूमने में निम्नलिखित में से कौन उपयोगी है?
Which of the following is useful in traversing a given graph by breadth first search?
  1. Aस्टैक (stack)Stack
  2. Bसेट (set)Set
  3. Cलिस्ट (list)List
  4. Dक्यू (queue)Queue
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 13उत्तर app में
किसी धनात्मक पूर्णांक K के लिए, यदि graph G के हर शीर्ष v की डिग्री d(v) = K हो, तो G को कहा जाता है —
For some positive integer K, if degree of vertex d(v) = K for every vertex v of the graph G, then G is called
  1. AK graph
  2. BK-नियमित graph (K-regular graph)K-regular graph
  3. Cरिक्त graph (empty graph)empty graph
  4. Dये सभीAll of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 14उत्तर app में
n शीर्षों और e किनारों वाले एक जुड़े हुए समतलीय (connected planar) graph में क्षेत्रों (regions) की संख्या होती है —
The number of regions in a connected planar graph with n vertices and e edges is
  1. An + e
  2. Be − n
  3. Ce − n + 2
  4. De/2
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 15उत्तर app में
पूर्ण द्विदलीय graph K(3, 3) और K(2, 4) के बारे में क्या सत्य है?
What is true for the complete bipartite graphs K(3, 3) and K(2, 4)?
  1. Aदोनों समतलीय (planar) हैंBoth are planar
  2. Bदोनों में से कोई समतलीय नहीं हैNeither is planar
  3. Cदोनों समरूपी (isomorphic) हैंBoth are isomorphic
  4. Dदोनों में से कोई भी समरूपी नहीं हैNeither is isomorphic
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 16उत्तर app में
n शीर्षों वाला graph G द्विपक्षीय (bipartite) होता है, यदि उसमें —
A graph G with n nodes is bipartite, if it contains
  1. An किनारे (edges) होंn edges
  2. Bविषम लंबाई (odd length) का एक चक्र होa cycle of odd length
  3. Cविषम लंबाई का कोई चक्र न होno cycle of odd length
  4. Dn2 किनारे होंn2 edges
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 18उत्तर app में
बिना किनारों वाले graph को रिक्त graph (empty graph) कहते हैं। empty graph को और किस नाम से जाना जाता है?
A graph with no edges is called an empty graph. An empty graph is also known as
  1. Aत्रिविअल graph (trivial graph)trivial graph
  2. Bनियमित graph (regular graph)regular graph
  3. Cद्विपक्षीय graph (bipartite graph)bipartite graph
  4. Dये सभीAll of these
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 19उत्तर app में
डिग्री एक वाले शीर्ष (vertex of degree one) को क्या कहा जाता है?
A vertex of degree one is called as
  1. Aपेंडेंट शीर्ष (pendant vertex)pendant vertex
  2. Bआइसोलेटेड शीर्ष (isolated vertex)isolated vertex
  3. Cनल शीर्ष (null vertex)null vertex
  4. Dरंगीन शीर्ष (coloured vertex)coloured vertex
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 20उत्तर app में
किसी graph के शीर्ष (vertex) को विषम (odd) या सम (even) कहा जाता है — यह किस बात पर निर्भर करता है?
A vertex of a graph is called odd or even depending on whether
  1. Agraph में किनारों (edges) की कुल संख्या विषम या सम हैtotal number of edges in a graph is odd or even
  2. Bशीर्षों (vertices) की कुल संख्या विषम या सम हैtotal number of vertices is odd or even
  3. Cउसकी डिग्री (degree) विषम या सम हैits degree is odd or even
  4. Dउपरोक्त सभीAll of the above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 21उत्तर app में
ग्राफ़ के किसी शीर्ष (vertex) की घात (degree) की परिभाषा क्या है?
What is the definition of the degree of a vertex of a graph?
  1. Aउस शीर्ष पर आपतित (incident) किनारों की संख्याthe number of edges incident with the vertex
  2. Bग्राफ़ में शीर्षों की संख्याnumber of vertices in a graph
  3. Cउस शीर्ष से सटे हुए शीर्षों की संख्याnumber of vertices adjacent to that vertex
  4. Dग्राफ़ में किनारों की संख्याnumber of edges in a graph
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 22उत्तर app में
ग्राफ़ के संबंध में निम्नलिखित में से कौन-सा कथन सत्य नहीं है?
Which of the following statements is not true regarding a graph?
  1. Aग्राफ़ में नोड्स का एक समुच्चय और आर्क्स का एक समुच्चय होता हैA graph consists of a set of nodes and a set of arcs
  2. Bएक ग्राफ़ एक ट्री होता हैA graph is a tree
  3. Cएक ट्री एक ग्राफ़ होता हैA tree is a graph
  4. Dग्राफ़ दिशायुक्त (directed) हो सकता हैA graph can be directed
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 23उत्तर app में
किसी ग्राफ़ G को ...... कहा जाता है यदि वह एक जुड़ा हुआ (connected) और अचक्रीय (acyclic) ग्राफ़ हो।
A graph G is called a ...... if it is a connected acyclic graph.
  1. Aचक्रीय ग्राफ़ (cyclic graph)cyclic graph
  2. Bनियमित ग्राफ़ (regular graph)regular graph
  3. Cट्री (tree)tree
  4. Dग्राफ़ नहीं (not a graph)not a graph
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 24उत्तर app में
ग्राफ़ किसका संग्रह होता है?
A graph is a collection of
  1. Aपंक्तियाँ और स्तंभ (rows and columns)rows and columns
  2. Bशीर्ष और किनारे (vertices and edges)vertices and edges
  3. Cसमीकरण (equations)equations
  4. Dपहचान (identity)identity
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 25उत्तर app में
किसी ग्राफ़ में सभी जोड़ों के बीच लघुतम पथ (all pairs shortest path) निकालने वाले एल्गोरिथ्म की समय जटिलता किससे सीमित होती है? (n = शीर्षों की संख्या)
The time complexity of the all pairs shortest path algorithm can be bounded by (n = number of vertices)
  1. AO(n²)
  2. BO(n⁴)
  3. CO(n³)
  4. DO(n)
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
प्रश्न 26उत्तर app में
निम्नलिखित कथनों में से सही कथन चुनिए:

I. किसी ग्राफ़ का न्यूनतम विस्तारी वृक्ष (minimal spanning tree) बनाते समय क्रुस्कल एल्गोरिथ्म में चुने गए किनारे हमेशा एक वन (forest) बनाते हैं।

II. प्रिम एल्गोरिथ्म में चुने गए किनारे हमेशा एक उपवन (orchard) बनाते हैं।

III. DFS और BFS एल्गोरिथ्म क्रमशः हमेशा क्यू और स्टैक का उपयोग करते हैं।
Pick the correct statement(s) from the following set of statements:

I. In Kruskal's algorithm, for the construction of a minimal spanning tree for a graph, the selected edges always form a forest.

II. In Prim's algorithm for the construction of a minimal spanning tree for a graph, the selected edges always form an orchard.

III. DFS and BFS algorithms always make use of a queue and a stack respectively.
  1. Aकेवल (I)Only (I) above
  2. Bकेवल (II)Only (II) above
  3. Cकेवल (III)Only (III) above
  4. D(I) और (III) दोनोंBoth (I) and (III) above
उत्तर और हल FliQi Question Bank app में देखें (Answer & solution in the app)
Graph के सभी 26 प्रश्न — उत्तर, हल और अभ्यास

FliQi Question Bank app में topic-वार अभ्यास, कठिनाई-स्तर और आपकी प्रगति।

  • पहला test मुफ़्त
  • हिंदी + English
  • जाँचे हुए उत्तर और हल

यह topic किन परीक्षाओं में आता है

DSA के दूसरे topics

सभी topics