Data Structures and Algorithms — MCQ Practice

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

📚 29 Questions 🌐 Hindi + English ✅ Free
भाषा / Language:
29 questions
16
EN + हिं Medium
GB Height of perfect binary tree with 15 nodes?
IN 15 नोड्स वाले पूर्ण बाइनरी ट्री की ऊंचाई?
A
2 2
B
3 3
C
4 4
D
5 5
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2^(h+1)-1=15 → 2^(h+1)=16 → h+1=4 → h=3.
व्याख्या (हिन्दी) 2^(h+1)-1=15 → 2^(h+1)=16 → h+1=4 → h=3.
17
EN + हिं Medium
GB Maximum nodes in binary tree of height 4?
IN ऊंचाई 4 के बाइनरी ट्री में अधिकतम नोड्स?
A
15 15
B
31 31
C
16 16
D
8 8
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) 2^(4+1)-1=31.
व्याख्या (हिन्दी) 2^(4+1)-1=31.
18
EN + हिं Medium
GB Number of leaf nodes in perfect binary tree of height h?
IN ऊँचाई h के पूर्ण बाइनरी वृक्ष में पत्ती नोड्स की संख्या?
A
2h 2 एच
B
h+1 एच+1
C
2^h 2^एच
D
2^(h-1) 2^(एच-1)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Leaf nodes in perfect binary tree of height h = 2^h.
व्याख्या (हिन्दी) ऊँचाई h = 2^h के पूर्ण बाइनरी ट्री में पत्ती नोड्स।
19
EN + हिं Medium
GB Preorder traversal used for?
IN प्रीऑर्डर ट्रैवर्सल का उपयोग किसके लिए किया जाता है?
A
Sorted output क्रमबद्ध आउटपुट
B
Creating copy of tree (serialization) पेड़ की प्रतिलिपि बनाना (क्रमबद्धता)
C
Deleting tree पेड़ हटाना
D
Finding height ऊंचाई ढूँढना
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Preorder: root processed first — useful for serialization/copy.
व्याख्या (हिन्दी) प्रीऑर्डर: रूट को पहले संसाधित किया गया - क्रमबद्धता/कॉपी के लिए उपयोगी।
20
EN + हिं Medium
GB Maximum leaf nodes in binary tree of height h?
IN ऊँचाई h के बाइनरी ट्री में अधिकतम पत्ती नोड्स?
A
2h 2 एच
B
h+1 एच+1
C
2^h 2^एच
D
h-1 एच-1
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Maximum leaves = 2^h (perfect binary tree case).
व्याख्या (हिन्दी) अधिकतम पत्तियाँ = 2^एच (परफेक्ट बाइनरी ट्री केस)।
21
EN + हिं Medium
GB Height of complete binary tree with 8 nodes?
IN 8 नोड्स वाले पूर्ण बाइनरी ट्री की ऊंचाई?
A
2 2
B
3 3
C
4 4
D
8 8
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) height=floor(log₂(8))=3.
व्याख्या (हिन्दी) ऊंचाई=मंजिल(लॉग₂(8))=3.
22
EN + हिं Medium
GB After inserting 1,2,3 into AVL tree, which rotation?
IN AVL ट्री में 1,2,3 डालने के बाद कौन सा घुमाव?
A
LL डालूँगा
B
RR आरआर
C
LR एलआर
D
RL आर एल
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Inserting 1,2,3 creates right-skewed tree — RR rotation balances it.
व्याख्या (हिन्दी) 1,2,3 डालने से दायीं ओर तिरछा पेड़ बनता है - आरआर रोटेशन इसे संतुलित करता है।
23
EN + हिं Medium
GB AVL tree LR rotation applied when?
IN एवीएल ट्री एलआर रोटेशन कब लागू किया गया?
A
New node in left of left child बाएँ बच्चे के बाएँ में नया नोड
B
New node in right of right child दाएँ बच्चे के दाएँ में नया नोड
C
New node in right of left child बाएँ बच्चे के दाएँ में नया नोड
D
New node in left of right child दाएँ बच्चे के बाएँ में नया नोड
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LR: new node in right subtree of left child of unbalanced node.
व्याख्या (हिन्दी) एलआर: असंतुलित नोड के बाएं बच्चे के दाएं उपवृक्ष में नया नोड।
24
EN + हिं Medium
GB B-tree insertion always occurs at?
IN बी-ट्री इंसर्शन हमेशा कहां होता है?
A
Root जड़
B
Leaf level पत्ती का स्तर
C
Random यादृच्छिक
D
Internal nodes आंतरिक नोड्स
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) B-tree insertion always at the leaf level (bottom-up approach).
व्याख्या (हिन्दी) बी-वृक्ष का सम्मिलन हमेशा पत्ती के स्तर पर (नीचे से ऊपर की ओर) होता है।
25
EN + हिं Medium
GB Full B-tree node during insertion: operation performed?
IN सम्मिलन के दौरान पूर्ण बी-ट्री नोड: ऑपरेशन निष्पादित हुआ?
A
Delete node नोड हटाएँ
B
Split at median, push median up माध्यिका पर विभाजित करें, माध्यिका को ऊपर की ओर धकेलें
C
New sibling arbitrarily नया भाई मनमाने ढंग से
D
Rebuild from scratch खरोंच से पुनर्निर्माण करें
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Full node: split at median, median key goes up, create two children.
व्याख्या (हिन्दी) पूर्ण नोड: मध्य पर विभाजित, मध्य कुंजी ऊपर जाती है, दो बच्चे बनाते हैं।
26
EN + हिं Medium
GB B-tree of order 5: minimum keys in non-root node?
IN क्रम 5 का बी-ट्री: गैर-रूट नोड में न्यूनतम कुंजियाँ?
A
1 1
B
2 2
C
3 3
D
4 4
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) ceil(m/2)-1 = ceil(5/2)-1 = 3-1 = 2 minimum keys.
व्याख्या (हिन्दी) ceil(m/2)-1 = ceil(5/2)-1 = 3-1 = 2 न्यूनतम कुंजियाँ।
27
EN + हिं Medium
GB Minimum degree t=2 B-tree: root has at least?
IN न्यूनतम डिग्री t=2 B-वृक्ष: जड़ में कम से कम?
A
t children टी बच्चे
B
2 children 2 बच्चे
C
No children needed बच्चों की जरूरत नहीं
D
m children एम बच्चे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) B-tree root has at least 2 children (and minimum 1 key).
व्याख्या (हिन्दी) बी-ट्री रूट में कम से कम 2 बच्चे (और न्यूनतम 1 कुंजी) होते हैं।
28
EN + हिं Medium
GB In B-tree, keys within each node stored in?
IN बी-ट्री में, प्रत्येक नोड के भीतर कुंजियाँ किसमें संग्रहीत होती हैं?
A
Descending order अवरोही क्रम
B
Random order अनियमित क्रम
C
Increasing order बढ़ता क्रम
D
Alphabetical only केवल वर्णक्रमानुसार
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) B-tree: keys within each node stored in increasing order.
व्याख्या (हिन्दी) बी-ट्री: प्रत्येक नोड के भीतर कुंजियाँ बढ़ते क्रम में संग्रहीत होती हैं।
29
EN + हिं Medium
GB B-tree maximum height formula for n keys, order t?
IN एन कुंजी के लिए बी-ट्री अधिकतम ऊंचाई सूत्र, ऑर्डर टी?
A
n-1 एन-1
B
log_t((n+1)/2) log_t((n+1)/2)
C
n/2 एन/2
D
log₂(n) लॉग₂(एन)
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Max height h >= log_t((n+1)/2).
व्याख्या (हिन्दी) अधिकतम ऊंचाई h >= log_t((n+1)/2).
16–29 of 29