प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is the minimum number of levels a binary tree must have to hold 100 nodes?
सही उत्तर: ख) 7
A binary tree with k levels holds at most 2^k - 1 nodes; 2^6 - 1 = 63 is too few, while 2^7 - 1 = 127 is enough.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In the linked representation of a binary tree with n nodes, how many child pointers are NULL?
सही उत्तर: घ) n + 1
There are 2n child pointers in all, and n - 1 of them point to actual nodes (one per edge), leaving 2n - (n - 1) = n + 1 NULL.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the time complexity of: for (i = 1; i <= n; i++) for (j = 1; j <= n; j += i) count++; ?
सही उत्तर: ग) O(n log n)
The inner loop runs about n/i times, and n/1 + n/2 + ... + n/n = n x (harmonic number), which is O(n log n).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A directed graph has edges A->B, A->C, B->D and C->D. Which of the following is a valid topological order?
सही उत्तर: घ) A C B D
In a topological order every edge goes from an earlier to a later vertex; A must come first and D last, which only A C B D satisfies.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A graph has edges A-B, A-D, B-C, D-E, C-F and E-F. A breadth-first search from A visits neighbours in alphabetical order. In what order are the vertices visited?
सही उत्तर: ख) A B D C E F
BFS visits A, then its neighbours B and D, then B's neighbour C, D's neighbour E, and finally F.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Keys 10, 17 and 24 are inserted into a hash table of size 7 using h(k) = k mod 7 with quadratic probing (h + i^2). At which index is 24 stored?
सही उत्तर: ग) 0
All three hash to 3. 10 goes to 3; 17 tries 3, then 3 + 1 = 4; 24 tries 3, 4 and then 3 + 4 = 7 mod 7 = 0.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
During merge sort, the sorted lists [1, 4, 7] and [2, 3, 9] are merged. How many key comparisons are made?
सही उत्तर: घ) 5
Comparisons: 1-2, 4-2, 4-3, 4-9, 7-9 (5 in all); then 9 is copied without comparison because the left list is empty.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Insertion sort (ascending) is applied to [5, 2, 4, 6, 1, 3]. What is the array after the first two passes (inserting the 2nd and then the 3rd element)?
सही उत्तर: घ) [2, 4, 5, 6, 1, 3]
Pass 1 inserts 2 before 5 giving [2, 5, 4, ...]; pass 2 inserts 4 between 2 and 5 giving [2, 4, 5, 6, 1, 3].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A Python dict literal {'a': 1, 'b': 2, 'a': 3} is created. What is its length?
सही उत्तर: ख) 2
Dictionary keys are unique; the repeated key 'a' simply overwrites the earlier value, leaving 2 keys.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the output of the Python code: x = [1, 2, 3]; print(x.pop(0), x) ?
सही उत्तर: ख) 1 [2, 3]
pop(0) removes and returns the element at index 0, leaving [2, 3].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।