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
136
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.
व्याख्या (हिन्दी) शब्दकोश: अद्वितीय कुंजियों के साथ कुंजी-मूल्य जोड़े का संग्रह।
137
EN + हिं Hard
GB Average time complexity for Python dictionary search?
IN पायथन शब्दकोश खोज के लिए औसत समय जटिलता?
A
O(n) पर)
B
O(log n) ओ(लॉग एन)
C
O(1) हे(1)
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Dictionary uses hashing — O(1) average for search/insert/delete.
व्याख्या (हिन्दी) शब्दकोश खोज/डालने/हटाने के लिए हैशिंग - O(1) औसत का उपयोग करता है।
138
EN + हिं Hard
GB Space complexity of recursive algorithm depth n?
IN पुनरावर्ती एल्गोरिथ्म गहराई n की अंतरिक्ष जटिलता?
A
O(1) हे(1)
B
O(n) due to call stack O(n) कॉल स्टैक के कारण
C
O(log n) ओ(लॉग एन)
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Recursion: O(n) space for call stack frames.
व्याख्या (हिन्दी) रिकर्सन: कॉल स्टैक फ़्रेम के लिए O(n) स्थान।
139
EN + हिं Hard
GB Naive recursive Fibonacci time complexity?
IN अनुभवहीन पुनरावर्ती फाइबोनैचि समय जटिलता?
A
O(n) पर)
B
O(log n) ओ(लॉग एन)
C
O(2^n) exponential O(2^n) घातीय
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Naive Fibonacci: O(2^n) — redundant recomputation of subproblems.
व्याख्या (हिन्दी) अनुभवहीन फाइबोनैचि: O(2^n) - उपसमस्याओं की निरर्थक पुनर्गणना।
140
EN + हिं Hard
GB Time complexity of Python list append()?
IN पायथन सूची की समय जटिलता संलग्न ()?
A
O(n) पर)
B
O(log n) ओ(लॉग एन)
C
O(1) amortized ओ(1) परिशोधन
D
O(n²) ओ(एन²)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) list.append() is O(1) amortized — occasionally triggers O(n) doubling.
व्याख्या (हिन्दी) list.append() O(1) परिशोधित है - कभी-कभी O(n) दोहरीकरण को ट्रिगर करता है।
141
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.
व्याख्या (हिन्दी) टकराव: दो अलग-अलग कुंजियाँ समान हैश इंडेक्स उत्पन्न करती हैं।
142
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.
व्याख्या (हिन्दी) चेनिंग: प्रत्येक बाल्टी में टकराने वाले तत्वों की एक लिंक की गई सूची होती है।
143
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.
व्याख्या (हिन्दी) खुला संबोधन: टकराव पर अगले उपलब्ध स्लॉट की जांच।
144
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=बाल्टी।
145
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.
व्याख्या (हिन्दी) ढेर: पूरा बाइनरी ट्री। अधिकतम-ढेर: माता-पिता>=बच्चे।
146
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).
व्याख्या (हिन्दी) अर्क-मिन: जड़ हटाएं, नीचे ढेर लगाएं - ओ(लॉग एन)।
147
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.
व्याख्या (हिन्दी) पायथन का हेपक मॉड्यूल मिन-हीप संचालन प्रदान करता है।
148
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) है - प्रत्यक्ष पता गणना।
149
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.
व्याख्या (हिन्दी) मिन-हीप: हर माता-पिता
150
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.
व्याख्या (हिन्दी) परिशोधन: संचालन के अनुक्रम में प्रति ऑपरेशन औसत लागत।
136–150 of 819