Data Structures and Algorithms — MCQ Practice

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

📚 819 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
819 questions

Question 166

EN + हिं Medium
GB Catalan number C(n) counts?
IN कैटलन संख्या सी(एन) मायने रखती है?
Nodes in BST बीएसटी में नोड्स
Distinct BSTs with n keys एन कुंजी के साथ विशिष्ट बीएसटी
Graph paths ग्राफ़ पथ
Complete graph edges पूर्ण ग्राफ किनारे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Catalan number = number of structurally distinct BSTs with n keys.
व्याख्या (हिन्दी) कैटलन संख्या = एन कुंजी के साथ संरचनात्मक रूप से अलग बीएसटी की संख्या।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 167

EN + हिं Medium
GB Which sorting is best for only 0s, 1s, 2s?
IN केवल 0s, 1s, 2s के लिए कौन सी सॉर्टिंग सर्वोत्तम है?
Merge sort मर्ज सॉर्ट
Quick sort त्वरित छँटाई
Dutch National Flag (3-way partition) डच राष्ट्रीय ध्वज (तीन-तरफा विभाजन)
Heap sort ढेर बनाएं और छांटें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Dutch National Flag sorts 0s/1s/2s in O(n) with single pass.
व्याख्या (हिन्दी) डच राष्ट्रीय ध्वज एकल पास के साथ O(n) में 0s/1s/2s सॉर्ट करता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 168

EN + हिं Hard
GB Building a heap from n elements time complexity?
IN एन तत्वों समय जटिलता से एक ढेर का निर्माण?
O(n log n) ओ(एन लॉग एन)
O(n) पर)
O(n²) ओ(एन²)
O(log n) ओ(लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Heapify from n elements (Floyd's algorithm) = O(n).
व्याख्या (हिन्दी) n तत्वों से ढेर बनाएं (फ्लोयड का एल्गोरिदम) = O(n)।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Hard"। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 169

EN + हिं Easy
GB What is a sparse graph?
IN विरल ग्राफ क्या है?
Few edges relative to vertices शीर्षों के सापेक्ष कुछ किनारे
Many edges अनेक किनारे
No vertices कोई शीर्ष नहीं
Complete graph पूरा ग्राफ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Sparse graph: E << V². Use adjacency list for sparse graphs.
व्याख्या (हिन्दी) विरल ग्राफ: ई
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Easy" उन students के लिए काम का है जो Railway, SSC, Banking और Defence परीक्षाओं की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 170

EN + हिं Medium
GB 2-3 tree is?
IN 2-3 पेड़ है?
Binary tree 2 or 3 children बाइनरी ट्री 2 या 3 बच्चे
B-tree of order 3 (each internal node 2 or 3 children) क्रम 3 का बी-ट्री (प्रत्येक आंतरिक नोड 2 या 3 बच्चे)
2 levels, 3 nodes 2 स्तर, 3 नोड
Exactly 3 leaves बिल्कुल 3 पत्ते
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2-3 tree: B-tree of order 3 — all leaves at same level.
व्याख्या (हिन्दी) 2-3 पेड़: क्रम 3 का बी-पेड़ - सभी पत्तियाँ समान स्तर पर।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 171

EN + हिं Medium
GB Python list.pop(0) vs list.pop() difference?
IN पायथन list.pop(0) बनाम list.pop() अंतर?
Both remove from end दोनों सिरे से हटा देते हैं
pop(0) removes front O(n); pop() removes end O(1) पॉप(0) सामने वाले O(n) को हटा देता है; पॉप() अंत O(1) को हटा देता है
pop(0) O(1); pop() O(n) पॉप(0) ओ(1); पर पॉप)
Identical समान
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) pop(0): O(n) due to shifting. pop(): O(1) from end.
व्याख्या (हिन्दी) पॉप(0): शिफ्टिंग के कारण O(n)। पॉप(): O(1) अंत से।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 172

EN + हिं Medium
GB BTreeSearch returns if key not found?
IN यदि कुंजी नहीं मिली तो BTreeSearch वापस आ जाता है?
-1 -1
NIL (NULL) शून्य (शून्य)
False असत्य
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) BTreeSearch returns NIL when key not found (leaf reached without finding).
व्याख्या (हिन्दी) कुंजी नहीं मिलने पर BTreeSearch शून्य लौटाता है (पत्ता बिना खोजे पहुंच जाता है)।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे SSC, Railway, Banking और State PCS में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 173

EN + हिं Medium
GB mid in mergesort([5,9,10,1,66])?
IN मर्जसॉर्ट में मध्य([5,9,10,1,66])?
2 2
3 3
5 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) mid=5//2=2. left=[5,9], right=[10,1,66].
व्याख्या (हिन्दी) मध्य=5//2=2. बाएँ=[5,9], दाएँ=[10,1,66]।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और SSC, Railway, Banking और State PCS के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 174

EN + हिं Medium
GB Result of quicksort([56,25,93,15,31,44])?
IN क्विकसॉर्ट का परिणाम([56,25,93,15,31,44])?
[93,56,44,31,25,15] [93,56,44,31,25,15]
[15,25,31,44,56,93] [15,25,31,44,56,93]
[15,44,25,31,56,93] [15,44,25,31,56,93]
[25,15,44,31,56,93] [25,15,44,31,56,93]
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Quicksort ascending: [15,25,31,44,56,93].
व्याख्या (हिन्दी) क्विकॉर्ट आरोही: [15,25,31,44,56,93]।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।

Question 175

EN + हिं Medium
GB Binary search on [12,24,32,39,45,50,54] for 45 returns?
IN 45 रिटर्न के लिए [12,24,32,39,45,50,54] पर बाइनरी खोज?
3 3
4 4
5 5
-1 -1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 45 is at index 4 (0-indexed).
व्याख्या (हिन्दी) 45 सूचकांक 4 (0-अनुक्रमित) पर है।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) से जुड़ा यह सवाल — difficulty level "Medium" उन students के लिए काम का है जो SSC, Railway, Banking और State PCS की तैयारी कर रहे हैं। बेहतर होगा कि explanation पढ़कर concept clear करें, ताकि exam में similar प्रश्न आने पर confusion न हो।

Question 176

EN + हिं Medium
GB dict.items() returns?
IN dict.items() रिटर्न?
Only keys केवल चाबियाँ
Only values केवल मूल्य
All key-value pairs as tuples सभी कुंजी-मूल्य जोड़े टुपल्स के रूप में
Count of items वस्तुओं की गिनती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) dict.items() returns all key-value pairs as tuples.
व्याख्या (हिन्दी) dict.items() सभी कुंजी-मूल्य जोड़े को टुपल्स के रूप में लौटाता है।
🎯 Exam Perspective
SSC CGL, IBPS, RRB और State-level परीक्षाओं जैसी परीक्षाओं में Data Structures and Algorithms ("Introduction to DSA" sub-topic) से सवाल अक्सर पूछे जाते हैं — difficulty level "Medium"। इसलिए सिर्फ answer रटने के बजाय, नीचे दी गई explanation को ध्यान से पढ़ें और concept समझें।

Question 177

EN + हिं Medium
GB Python set vs list membership check?
IN पायथन सेट बनाम सूची सदस्यता जांच?
Both O(1) दोनों O(1)
Both O(n) दोनों पर)
List O(n); Set O(1) average सूची ओ(एन); O(1) औसत सेट करें
List O(log n); Set O(1) सूची ओ(लॉग एन); सेट ओ(1)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) List: O(n) scan; Set: O(1) average with hashing.
व्याख्या (हिन्दी) सूची: O(n) स्कैन; सेट: हेशिंग के साथ ओ(1) औसत।
🎯 Exam Perspective
अगर आप UPSC, SSC, Banking और Police भर्ती की तैयारी कर रहे हैं, तो Data Structures and Algorithms ("Introduction to DSA" sub-topic) का यह topic आपके लिए महत्वपूर्ण है — difficulty level "Medium"। Exam में accuracy बढ़ाने के लिए हर सवाल की explanation जरूर पढ़ें।

Question 178

EN + हिं Medium
GB Tuple vs list in Python?
IN पायथन में टुपल बनाम सूची?
Both mutable दोनों परिवर्तनशील
List immutable; Tuple mutable सूची अपरिवर्तनीय; टपल परिवर्तनशील
Tuple immutable and hashable; List mutable टपल अपरिवर्तनीय और धोने योग्य; सूची परिवर्तनशील
Both immutable दोनों अपरिवर्तनीय
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Tuple: immutable, hashable. List: mutable, not hashable.
व्याख्या (हिन्दी) टपल: अपरिवर्तनीय, धोने योग्य। सूची: परिवर्तनशील, धोने योग्य नहीं।
🎯 Exam Perspective
Data Structures and Algorithms ("Introduction to DSA" sub-topic) के इस प्रश्न को — difficulty level "Medium" कई प्रतियोगी परीक्षाओं जैसे Railway, SSC, Banking और Defence परीक्षाओं में repeat होते देखा गया है। Concept clarity के लिए explanation section जरूर पढ़ें।

Question 179

EN + हिं Medium
GB Ford-Fulkerson algorithm solves:
IN फोर्ड-फ़ल्कर्सन एल्गोरिदम हल करता है:
Shortest path सबसे छोटा रास्ता
Maximum flow in a network किसी नेटवर्क में अधिकतम प्रवाह
Minimum spanning tree न्यूनतम फैलाव वाला पेड़
Topological sort टोपोलॉजिकल सॉर्ट
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Ford-Fulkerson finds max-flow using augmenting paths.
व्याख्या (हिन्दी) फोर्ड-फ़ल्कर्सन संवर्द्धन पथों का उपयोग करके अधिकतम-प्रवाह पाता है।
🎯 Exam Perspective
यह सवाल Data Structures and Algorithms ("Introduction to DSA" sub-topic) category का है — difficulty level "Medium", और SSC CGL, IBPS, RRB और State-level परीक्षाओं के exam pattern में इस तरह के questions common हैं। Answer choose करने के बाद दिया गया explanation जरूर पढ़ें।

Question 180

EN + हिं Medium
GB Longest Increasing Subsequence (LIS) of {3,10,2,1,20} has length:
IN {3,10,2,1,20} की सबसे लंबी बढ़ती अनुवर्ती (एलआईएस) की लंबाई है:
2 2
3 3
4 4
5 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LIS = {3,10,20} or {1,20} → max length 3.
व्याख्या (हिन्दी) एलआईएस = {3,10,20} या {1,20} → अधिकतम लंबाई 3।
🎯 Exam Perspective
यह प्रश्न Data Structures and Algorithms ("Introduction to DSA" sub-topic) की तैयारी करने वाले अभ्यर्थियों के लिए उपयोगी है — difficulty level "Medium"। इस तरह के प्रश्न अक्सर SSC, Railway, Banking और State PCS जैसी परीक्षाओं में पूछे जाते रहे हैं, इसलिए concept और explanation दोनों को ध्यान से समझें, सिर्फ उत्तर याद न करें।