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
286
EN + हिं Medium
GB Hash collision is?
IN हैश टक्कर है?
A
Two keys hash to same index एक ही सूचकांक में दो कुंजियाँ हैश
B
Hash returns negative हैश नकारात्मक लौटाता है
C
Keys are identical कुंजियाँ समान हैं
D
Hash table empty हैश टेबल खाली
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Collision: two different keys produce the same hash index.
व्याख्या (हिन्दी) टकराव: दो अलग-अलग कुंजियाँ समान हैश इंडेक्स उत्पन्न करती हैं।
287
EN + हिं Medium
GB Chaining in hash tables?
IN हैश तालिकाओं में चेनिंग?
A
Connecting hash tables हैश टेबल कनेक्ट करना
B
Colliding elements in linked list at same bucket एक ही बकेट में लिंक्ड सूची में तत्वों का टकराना
C
Probing for next slot अगले स्लॉट के लिए जांच हो रही है
D
Resizing table तालिका का आकार बदलना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Chaining: each bucket has a linked list of colliding elements.
व्याख्या (हिन्दी) चेनिंग: प्रत्येक बाल्टी में टकराने वाले तत्वों की एक लिंक की गई सूची होती है।
288
EN + हिं Medium
GB Open addressing in hash tables?
IN हैश टेबल में एड्रेसिंग खोलें?
A
Linked lists for collisions टकरावों के लिए लिंक की गई सूचियाँ
B
All collisions in same bucket सभी टकराव एक ही बाल्टी में
C
Finding next available slot in array सरणी में अगला उपलब्ध स्लॉट ढूँढना
D
Separate overflow table अलग अतिप्रवाह तालिका
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Open addressing: probe for next available slot on collision.
व्याख्या (हिन्दी) खुला संबोधन: टकराव पर अगले उपलब्ध स्लॉट की जांच।
289
EN + हिं Medium
GB Load factor of hash table?
IN हैश टेबल का लोड फैक्टर?
A
Buckets/Elements बाल्टी/तत्व
B
Elements/Buckets तत्व/बाल्टियाँ
C
Size of hash function हैश फ़ंक्शन का आकार
D
Number of collisions टकरावों की संख्या
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Load factor = n/m where n=elements, m=buckets.
व्याख्या (हिन्दी) लोड फैक्टर = n/m जहां n=तत्व, m=बाल्टी।
290
EN + हिं Medium
GB Heap data structure?
IN ढेर डेटा संरचना?
A
Linear array रैखिक सरणी
B
Complete binary tree with heap property ढेर संपत्ति के साथ पूरा बाइनरी ट्री
C
Sorted linked list क्रमबद्ध लिंक्ड सूची
D
Graph no cycles ग्राफ़ कोई चक्र नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Heap: complete binary tree. Max-heap: parent>=children.
व्याख्या (हिन्दी) ढेर: पूरा बाइनरी ट्री। अधिकतम-ढेर: माता-पिता>=बच्चे।
291
EN + हिं Hard
GB Extract minimum from min-heap time complexity?
IN न्यूनतम-ढेर समय जटिलता से न्यूनतम निकालें?
A
O(1) हे(1)
B
O(log n) ओ(लॉग एन)
C
O(n) पर)
D
O(n log n) ओ(एन लॉग एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Extract-min: remove root, heapify down — O(log n).
व्याख्या (हिन्दी) अर्क-मिन: जड़ हटाएं, नीचे ढेर लगाएं - ओ(लॉग एन)।
292
EN + हिं Medium
GB Python module for heap operations?
IN ढेर संचालन के लिए पायथन मॉड्यूल?
A
stack ढेर
B
queue कतार
C
heapq heapq
D
collections संग्रह
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Python's heapq module provides min-heap operations.
व्याख्या (हिन्दी) पायथन का हेपक मॉड्यूल मिन-हीप संचालन प्रदान करता है।
293
EN + हिं Hard
GB Time complexity of accessing element at index i in array?
IN सरणी में सूचकांक I पर तत्व तक पहुँचने की समय जटिलता?
A
O(n) पर)
B
O(log n) ओ(लॉग एन)
C
O(1) हे(1)
D
O(i) हे(i)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Array element access by index is O(1) — direct address calculation.
व्याख्या (हिन्दी) इंडेक्स द्वारा ऐरे एलिमेंट एक्सेस O(1) है - प्रत्यक्ष पता गणना।
294
EN + हिं Medium
GB Min-heap property?
IN न्यूनतम-ढेर संपत्ति?
A
Parent >= children माता-पिता >= बच्चे
B
Parent <= children माता-पिता
C
All leaves same level सभी पत्ते समान स्तर के हैं
D
Left > right child बाएँ > दाएँ बच्चा
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Min-heap: every parent <= both children. Root has minimum element.
व्याख्या (हिन्दी) मिन-हीप: हर माता-पिता
295
EN + हिं Medium
GB Tree vs graph difference?
IN पेड़ बनाम ग्राफ़ अंतर?
A
No difference कोई फर्क नहीं
B
Tree is connected acyclic graph with n-1 edges for n nodes ट्री एन नोड्स के लिए एन-1 किनारों के साथ एसाइक्लिक ग्राफ से जुड़ा हुआ है
C
Graph cannot be traversed ग्राफ़ को पार नहीं किया जा सकता
D
Tree allows multiple parents पेड़ एकाधिक माता-पिता की अनुमति देता है
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Tree is a special graph: connected, undirected, acyclic, n-1 edges.
व्याख्या (हिन्दी) वृक्ष एक विशेष ग्राफ़ है: जुड़ा हुआ, अप्रत्यक्ष, अचक्रीय, n-1 किनारा।
296
EN + हिं Hard
GB Time complexity of finding middle node of linked list?
IN लिंक्ड सूची के मध्य नोड को खोजने की समय जटिलता?
A
O(1) हे(1)
B
O(log n) ओ(लॉग एन)
C
O(n) पर)
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Finding middle requires O(n) traversal (or slow/fast pointer in O(n)).
व्याख्या (हिन्दी) मध्य खोजने के लिए O(n) ट्रैवर्सल (या O(n) में धीमा/तेज़ पॉइंटर) की आवश्यकता होती है।
297
EN + हिं Medium
GB Insertion at beginning of array of n elements?
IN एन तत्वों की सरणी की शुरुआत में सम्मिलन?
A
O(1) हे(1)
B
O(log n) ओ(लॉग एन)
C
O(n) पर)
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Insert at beginning requires shifting all n elements — O(n).
व्याख्या (हिन्दी) शुरुआत में सम्मिलित करने के लिए सभी n तत्वों - O(n) को स्थानांतरित करने की आवश्यकता होती है।
298
EN + हिं Hard
GB Amortized time complexity?
IN परिशोधन समय जटिलता?
A
Worst case single operation सबसे खराब स्थिति एकल ऑपरेशन
B
Average cost per operation over sequence अनुक्रम पर प्रति ऑपरेशन औसत लागत
C
Best case सर्वोत्तम मामला
D
After optimization अनुकूलन के बाद
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Amortized: average cost per operation over a sequence of operations.
व्याख्या (हिन्दी) परिशोधन: संचालन के अनुक्रम में प्रति ऑपरेशन औसत लागत।
299
EN + हिं Hard
GB Python set membership check time complexity?
IN पायथन सेट सदस्यता जांच समय जटिलता?
A
O(n) पर)
B
O(log n) ओ(लॉग एन)
C
O(1) average ओ(1) औसत
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Python set uses hashing — O(1) average membership check.
व्याख्या (हिन्दी) पायथन सेट हैशिंग का उपयोग करता है - O(1) औसत सदस्यता जांच।
300
EN + हिं Medium
GB Trie (prefix tree) is?
IN ट्राई (उपसर्ग वृक्ष) है?
A
BST for integers पूर्णांकों के लिए BST
B
Tree storing strings, each node=character वृक्ष भंडारण तार, प्रत्येक नोड=वर्ण
C
Type of heap ढेर का प्रकार
D
Circular linked list परिपत्र लिंक्ड सूची
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Trie: tree-like DS; each node represents a character.
व्याख्या (हिन्दी) ट्राई: पेड़ जैसा डीएस; प्रत्येक नोड एक वर्ण का प्रतिनिधित्व करता है।
286–300 of 1018