प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
Apply the master theorem to a divide-and-conquer algorithm that makes three recursive calls on halves and does linear extra work, T(n) = 3T(n/2) + n. Its running time is:
सही उत्तर: क) O(n^(log2 3)), about O(n^1.585)
Here a = 3, b = 2 and f(n) = n; since n^(log2 3) grows faster than n, case 1 gives O(n^(log2 3)).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A directed graph has only the edges A->B and A->C (three vertices A, B, C). How many different topological orderings does it have?
सही उत्तर: घ) 2
A must come first; B and C have no constraint between them, so the orders are A B C and A C B.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A graph that is a single cycle of n vertices is called Cn. Which of the following is NOT bipartite?
सही उत्तर: ग) C5
A cycle graph is bipartite only when its length is even; C5 is an odd cycle, so its vertices cannot be split into two colour classes.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The value 10 is inserted into the max-heap stored as the array [9, 7, 8, 3, 2, 6]. After the usual sift-up, the array becomes:
सही उत्तर: ख) [10, 7, 9, 3, 2, 6, 8]
10 goes to index 6; its parent (index 2) holds 8, so they swap; the new parent (index 0) holds 9, so they swap again.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The keys 15, 10, 20, 8, 12, 17, 25 are inserted into an empty binary search tree. If the root is then deleted by replacing it with its inorder successor, what is the new root?
सही उत्तर: क) 17
The inorder successor of 15 is the smallest key in its right subtree (20, 17, 25), which is 17.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Using the standard rule that ^ (exponentiation) is right-associative, the infix expression A ^ B ^ C converts to which postfix expression?
सही उत्तर: घ) A B C ^ ^
Right-associativity means A ^ (B ^ C), so B C ^ is formed first and then A is raised to it: A B C ^ ^.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Determine the output of this Python 3 code: print(sum(j for i in range(1, 4) for j in range(i)))
सही उत्तर: ग) 4
For i = 1, 2, 3 the inner values are (0), (0, 1) and (0, 1, 2), whose total is 4.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Determine the output of this Python 3 code: a = {1, 2, 3}; b = {3, 4}; print(a.isdisjoint(b), len(a | b))
सही उत्तर: ख) False 4
The sets share 3, so they are not disjoint; their union {1, 2, 3, 4} has 4 elements.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Determine the output of this Python 3 code: print(max([3, 7, 2], key=lambda x: -x))
सही उत्तर: क) 2
max compares the keys -3, -7 and -2; the largest key is -2, which belongs to the element 2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Determine the output of this Python 3 code: print(list(filter(lambda w: w == w[::-1], ['madam', 'nepal', 'noon'])))
सही उत्तर: घ) ['madam', 'noon']
The filter keeps palindromes, words that read the same backwards: 'madam' and 'noon'.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।