Data Structures and Algorithms — MCQ Practice

Hindi aur English dono mein practice karo — click karo answer check karne ke liye

📚 1018 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
1018 questions
256
EN + हिं Medium
GB MST with n vertices has how many edges?
IN n शीर्षों वाले MST में कितने किनारे होते हैं?
A
n एन
B
n-1 एन-1
C
n+1 एन+1
D
n(n-1)/2 n(n-1)/2
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) MST always has exactly n-1 edges.
व्याख्या (हिन्दी) MST में हमेशा बिल्कुल n-1 किनारे होते हैं।
257
EN + हिं Medium
GB Bipartite graph?
IN द्विदलीय ग्राफ?
A
Divided into two sets, edges only between sets दो सेटों में विभाजित, केवल सेटों के बीच किनारे
B
Exactly two components बिल्कुल दो घटक
C
Complete with even vertices सम शीर्षों से पूर्ण
D
Only two edges केवल दो किनारे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Bipartite: two independent sets U and V, edges only between U and V.
व्याख्या (हिन्दी) द्विदलीय: दो स्वतंत्र सेट यू और वी, किनारे केवल यू और वी के बीच।
258
EN + हिं Medium
GB Euler path in graph?
IN ग्राफ़ में यूलर पथ?
A
Visits every vertex once प्रत्येक शीर्ष पर एक बार जाएँ
B
Traverses every edge exactly once प्रत्येक किनारे को ठीक एक बार पार करता है
C
Shortest path सबसे छोटा रास्ता
D
Cycle through all vertices सभी शीर्षों से होकर गुजरें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Euler path visits every edge exactly once.
व्याख्या (हिन्दी) यूलर पथ प्रत्येक किनारे पर ठीक एक बार जाता है।
259
EN + हिं Medium
GB Hamiltonian path?
IN हैमिल्टनियन पथ?
A
Every edge once हर किनारा एक बार
B
Every vertex exactly once प्रत्येक शिखर बिल्कुल एक बार
C
Longest path सबसे लंबा रास्ता
D
Minimum weight path न्यूनतम वजन पथ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Hamiltonian path visits every vertex exactly once (NP-complete).
व्याख्या (हिन्दी) हैमिल्टनियन पथ प्रत्येक शीर्ष पर ठीक एक बार जाता है (एनपी-पूर्ण)।
260
EN + हिं Medium
GB Kosaraju's or Tarjan's algorithm finds?
IN कोसाराजू या टारजन का एल्गोरिदम मिलता है?
A
MST एमएसटी
B
Shortest path सबसे छोटा रास्ता
C
Strongly Connected Components मजबूती से जुड़े हुए घटक
D
Topological order स्थलाकृतिक क्रम
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Both find SCCs in directed graphs in O(V+E) time.
व्याख्या (हिन्दी) दोनों O(V+E) समय में निर्देशित ग्राफ़ में SCCs पाते हैं।
261
EN + हिं Medium
GB Bellman-Ford handles?
IN बेलमैन-फ़ोर्ड संभालता है?
A
MST एमएसटी
B
Single-source shortest path including negative weights नकारात्मक भार सहित एकल-स्रोत सबसे छोटा पथ
C
Topological sort टोपोलॉजिकल सॉर्ट
D
Cycle detection only केवल चक्र का पता लगाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Bellman-Ford: single-source shortest path with negative edge weights. O(VE).
व्याख्या (हिन्दी) बेलमैन-फोर्ड: नकारात्मक बढ़त भार के साथ एकल-स्रोत सबसे छोटा पथ। ओ(वीई).
262
EN + हिं Medium
GB Floyd-Warshall algorithm?
IN फ्लोयड-वॉर्शल एल्गोरिदम?
A
Single-source shortest एकल-स्रोत सबसे छोटा
B
MST एमएसटी
C
All-pairs shortest path सभी युग्म सबसे छोटा पथ
D
Cycle detection चक्र का पता लगाना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Floyd-Warshall: all-pairs shortest path in O(V³).
व्याख्या (हिन्दी) फ्लोयड-वॉर्शल: O(V³) में सभी जोड़े का सबसे छोटा पथ।
263
EN + हिं Hard
GB Topological sort time complexity using DFS?
IN डीएफएस का उपयोग कर टोपोलॉजिकल सॉर्ट समय जटिलता?
A
O(V²) ओ(वी²)
B
O(V+E) ओ(वी+ई)
C
O(V log V) ओ(वी लॉग वी)
D
O(E log V) ओ(ई लॉग वी)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Topological sort = O(V+E) using DFS.
व्याख्या (हिन्दी) टोपोलॉजिकल सॉर्ट = O(V+E) DFS का उपयोग करते हुए।
264
EN + हिं Medium
GB A data structure is?
IN एक डेटा संरचना है?
A
Programming language feature प्रोग्रामिंग भाषा सुविधा
B
Way to organize and store data for efficient access कुशल पहुंच के लिए डेटा को व्यवस्थित और संग्रहीत करने का तरीका
C
Database management डेटाबेस प्रबंधन
D
Sorting algorithm छँटाई एल्गोरिथ्म
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) DS: way to organize, manage, store data for efficient access/modification.
व्याख्या (हिन्दी) डीएस: कुशल पहुंच/संशोधन के लिए डेटा को व्यवस्थित, प्रबंधित, संग्रहीत करने का तरीका।
265
EN + हिं Medium
GB Linear data structure example?
IN रैखिक डेटा संरचना उदाहरण?
A
Tree पेड़
B
Graph ग्राफ़
C
Stack ढेर
D
Heap ढेर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Stack is linear; Trees and Graphs are non-linear.
व्याख्या (हिन्दी) स्टैक रैखिक है; पेड़ और ग्राफ़ अरैखिक हैं।
266
EN + हिं Medium
GB Non-linear data structure example?
IN गैर-रेखीय डेटा संरचना उदाहरण?
A
Array सरणी
B
Linked List लिंक्ड सूची
C
Queue कतार
D
Graph ग्राफ़
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Graph is non-linear — elements can connect to more than two others.
व्याख्या (हिन्दी) ग्राफ़ गैर-रैखिक है - तत्व दो से अधिक अन्य से जुड़ सकते हैं।
267
EN + हिं Medium
GB Array is?
IN ऐरे है?
A
Collection of nodes with pointers पॉइंटर्स के साथ नोड्स का संग्रह
B
Elements of same type at contiguous memory locations सन्निहित स्मृति स्थानों पर एक ही प्रकार के तत्व
C
Key-value pairs कुंजी-मूल्य जोड़े
D
Hierarchical structure पदानुक्रमित संरचना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Array: same data type elements at contiguous memory locations.
व्याख्या (हिन्दी) सारणी: सन्निहित स्मृति स्थानों पर समान डेटा प्रकार के तत्व।
268
EN + हिं Medium
GB Linear DS elements are stored?
IN रैखिक डीएस तत्व संग्रहीत हैं?
A
Hierarchically पदानुक्रम
B
Randomly बेतरतीब
C
Sequentially, connected to prev and next क्रमिक रूप से, पिछला और अगला से जुड़ा हुआ
D
Separate memory blocks अलग मेमोरी ब्लॉक
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Linear DS: elements stored sequentially with prev/next connections.
व्याख्या (हिन्दी) रैखिक डीएस: तत्वों को पिछले/अगले कनेक्शन के साथ क्रमिक रूप से संग्रहीत किया जाता है।
269
EN + हिं Medium
GB In non-linear DS, element can connect to?
IN नॉन-लीनियर डीएस में, तत्व किससे जुड़ सकता है?
A
Exactly two बिल्कुल दो
B
Only one केवल एक
C
More than two दो से अधिक
D
No elements कोई तत्व नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Non-linear DS: elements can connect to more than two others.
व्याख्या (हिन्दी) गैर-रेखीय डीएस: तत्व दो से अधिक अन्य से जुड़ सकते हैं।
270
EN + हिं Medium
GB Python dictionary is?
IN पायथन डिक्शनरी है?
A
Ordered collection संग्रह का आदेश दिया
B
Collection of key-value pairs कुंजी-मूल्य जोड़े का संग्रह
C
Sorted array of strings तारों की क्रमबद्ध सारणी
D
Stack-based ढेर आधारित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Dictionary: collection of key-value pairs with unique keys.
व्याख्या (हिन्दी) शब्दकोश: अद्वितीय कुंजियों के साथ कुंजी-मूल्य जोड़े का संग्रह।
256–270 of 1018