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
76
EN + हिं Easy
GB What is self.tail.next set to after adding node at end of doubly LL?
IN डबली एलएल के अंत में नोड जोड़ने के बाद self.tail.next को किस पर सेट किया जाता है?
A
New node नया नोड
B
NULL/None शून्य/कोई नहीं
C
Head सिर
D
Previous tail पिछली पूँछ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) self.tail=newNode; self.tail.next=None.
व्याख्या (हिन्दी) self.tail=newNode; self.tail.next=कोई नहीं.
77
EN + हिं Medium
GB In circular LL add() when empty, newNode.next=?
IN सर्कुलर एलएल में खाली होने पर() जोड़ें, newNode.next=?
A
None कोई नहीं
B
head सिर
C
newNode itself न्यूनोड स्वयं
D
tail पूँछ
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Empty: self.head=newNode; self.tail=newNode; newNode.next=self.head.
व्याख्या (हिन्दी) खाली: self.head=newNode; self.tail=newNode; newNode.next=self.head.
78
EN + हिं Medium
GB Circular LL display() while loop stops when?
IN सर्कुलर एलएल डिस्प्ले() जबकि लूप कब रुकता है?
A
current.next!=None current.next!=कोई नहीं
B
current.next!=self.head current.next!=self.head
C
current==self.tail वर्तमान==स्वयं.पूंछ
D
current.data==0 वर्तमान.डेटा==0
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Stop when current.next==self.head (completed the circle).
व्याख्या (हिन्दी) जब current.next==self.head (सर्कल पूरा हो जाए) रुकें।
79
EN + हिं Medium
GB Doubly LL display() after adding 1,2,3,4,5?
IN 1,2,3,4,5 जोड़ने के बाद दोगुना एलएल डिस्प्ले()?
A
5 4 3 2 1 5 4 3 2 1
B
1 2 3 4 5 1 2 3 4 5
C
Random यादृच्छिक
D
Error गलती
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Nodes appended in order; display starts from head: 1 2 3 4 5.
व्याख्या (हिन्दी) क्रम में जोड़े गए नोड्स; डिस्प्ले सिर से शुरू होता है: 1 2 3 4 5।
80
EN + हिं Medium
GB Circular LL advantage over singly LL?
IN एकल एलएल पर सर्कुलर एलएल का लाभ?
A
Less memory कम स्मृति
B
Traverse entire list from any node किसी भी नोड से पूरी सूची को ट्रैवर्स करें
C
Bidirectional traversal द्विदिशीय ट्रैवर्सल
D
O(1) random access ओ(1) यादृच्छिक अभिगम
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Circular LL: any node can be starting point to visit all nodes.
व्याख्या (हिन्दी) सर्कुलर एलएल: कोई भी नोड सभी नोड्स पर जाने के लिए शुरुआती बिंदु हो सकता है।
81
EN + हिं Medium
GB Floyd's cycle detection uses?
IN फ्लोयड के चक्र का पता लगाने का उपयोग करता है?
A
Two queues दो कतारें
B
Binary search द्विआधारी खोज
C
Slow and fast pointer धीमा और तेज़ सूचक
D
Stack ढेर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Floyd's: slow moves 1 step, fast moves 2. If they meet = cycle.
व्याख्या (हिन्दी) फ्लोयड: धीमी चाल 1 कदम, तेज़ चाल 2। यदि वे मिलते हैं = साइकिल।
82
EN + हिं Medium
GB In circular LL with 4 nodes A,B,C,D starting at A, node after 5 steps?
IN वृत्ताकार एलएल में 4 नोड्स ए, बी, सी, डी के साथ ए से शुरू होकर, 5 चरणों के बाद नोड?
A
A
B
B बी
C
C सी
D
D डी
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) A(0)→B(1)→C(2)→D(3)→A(4)→B(5). B after 5 steps.
व्याख्या (हिन्दी) A(0)→B(1)→C(2)→D(3)→A(4)→B(5). 5 चरणों के बाद बी.
83
EN + हिं Medium
GB Topmost node of a tree?
IN पेड़ का सबसे ऊपरी नोड?
A
Child बच्चा
B
Leaf पत्ता
C
Root जड़
D
Sibling भाई बहन
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Root is the topmost node with no parent.
व्याख्या (हिन्दी) रूट सबसे ऊपरी नोड है जिसका कोई पेरेंट नहीं है।
84
EN + हिं Medium
GB Nodes with no children are called?
IN बिना संतान वाले नोड्स को क्या कहा जाता है?
A
Root nodes रूट नोड्स
B
Internal nodes आंतरिक नोड्स
C
Parent nodes मूल नोड्स
D
Leaf nodes पत्ती की गांठे
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Leaf nodes (external nodes) have no children.
व्याख्या (हिन्दी) लीफ नोड्स (बाहरी नोड्स) की कोई संतान नहीं है।
85
EN + हिं Medium
GB Degree of a node?
IN एक नोड की डिग्री?
A
Depth of node नोड की गहराई
B
Edges connected किनारे जुड़े हुए हैं
C
Maximum number of children बच्चों की अधिकतम संख्या
D
Level स्तर
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Node degree = maximum number of children a node has.
व्याख्या (हिन्दी) नोड डिग्री = एक नोड में बच्चों की अधिकतम संख्या।
86
EN + हिं Medium
GB Level of root node?
IN रूट नोड का स्तर?
A
1 1
B
-1 -1
D
Undefined अपरिभाषित
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Root is at level 0; its children at level 1, etc.
व्याख्या (हिन्दी) रूट 0 स्तर पर है; इसके बच्चे स्तर 1 आदि पर हैं।
87
EN + हिं Medium
GB Inorder predecessor is?
IN इनऑर्डर पूर्ववर्ती है?
A
Smallest in right child दाएं बच्चे में सबसे छोटा
B
Largest in left child बाएं बच्चे में सबसे बड़ा
C
Parent node मूल नोड
D
Rightmost leaf सबसे दाहिना पत्ता
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Inorder predecessor = largest key in left child subtree.
व्याख्या (हिन्दी) इनऑर्डर पूर्ववर्ती = बाएं चाइल्ड सबट्री में सबसे बड़ी कुंजी।
88
EN + हिं Medium
GB Inorder successor is?
IN इनऑर्डर उत्तराधिकारी है?
A
Largest in right child सही बच्चे में सबसे बड़ा
B
Parent माता-पिता
C
Smallest in right child subtree दाएँ चाइल्ड उपवृक्ष में सबसे छोटा
D
Leftmost leaf सबसे बायाँ पत्ता
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) Inorder successor = smallest key in right child subtree.
व्याख्या (हिन्दी) इनऑर्डर उत्तराधिकारी = दाएं चाइल्ड सबट्री में सबसे छोटी कुंजी।
89
EN + हिं Medium
GB LL rotation: every node moves?
IN एलएल रोटेशन: हर नोड चलता है?
A
One position right एक स्थिति सही है
B
One position left एक पद बाकी है
C
Two positions right दो स्थान सही
D
No movement कोई संचलन नहीं
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) LL rotation: every node moves one position to the left.
व्याख्या (हिन्दी) एलएल रोटेशन: प्रत्येक नोड एक स्थान बाईं ओर चलता है।
90
EN + हिं Medium
GB RR rotation: every node moves?
IN आरआर रोटेशन: हर नोड चलता है?
A
One position left एक पद बाकी है
B
One position right एक स्थिति सही है
C
Two positions left दो पद बचे हैं
D
Two positions right दो स्थान सही
✅ Correct Answer:
💡 Explanation / व्याख्या
Explanation (English) RR rotation: every node moves one position to the right.
व्याख्या (हिन्दी) आरआर रोटेशन: प्रत्येक नोड एक स्थान दाईं ओर बढ़ता है।
76–90 of 819