प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
The max-heap stored in an array is [50, 30, 40, 10, 20]. After deleting the maximum (moving the last element to the root and sifting it down), the array becomes:
सही उत्तर: ख) [40, 30, 20, 10]
20 moves to the root and is swapped with its larger child 40, giving [40, 30, 20, 10].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The keys 8, 3, 10, 1, 6, 14, 4, 7, 13 are inserted in that order into an empty binary search tree. How many levels does the tree have (the root forming level 1)?
सही उत्तर: घ) 4
The longest path is 8 -> 3 -> 6 -> 4 (also 8 -> 10 -> 14 -> 13), which has 4 levels.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Evaluate the prefix (Polish) expression + 5 * 2 - 7 3.
सही उत्तर: क) 13
- 7 3 = 4, * 2 4 = 8, + 5 8 = 13.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print(sum(int(d) for d in str(2024)))
सही उत्तर: ख) 8
The digits of 2024 are 2, 0, 2, 4, and their sum is 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print({1, 2, 3} <= {1, 2, 3, 4}, {1, 2} | {3})
सही उत्तर: ग) True {1, 2, 3}
<= tests for a subset (True), and | gives the union {1, 2, 3}.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print('-'.join('abc'))
सही उत्तर: क) a-b-c
A string is an iterable of characters, so join() places '-' between 'a', 'b' and 'c'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? s = 'Mississippi'; print(s.count('ss'), s.index('p'))
सही उत्तर: घ) 2 8
'ss' occurs twice (non-overlapping), and the first 'p' is at index 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? print(list(filter(None, [0, 1, '', 'a', None])))
सही उत्तर: ग) [1, 'a']
filter(None, ...) keeps only truthy items; 0, '' and None are falsy.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? fs = [lambda i=i: i for i in range(3)]; print([f() for f in fs])
सही उत्तर: क) [0, 1, 2]
The default argument i=i captures the current value of i when each lambda is created.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What does the following Python code print? a = [[0] * 2 for _ in range(2)]; a[0][0] = 5; print(a)
सही उत्तर: ख) [[5, 0], [0, 0]]
The comprehension creates two separate inner lists, so changing a[0] does not affect a[1].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।