प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
The Longest Common Subsequence (LCS) of two strings is usually found using:
सही उत्तर: ग) Dynamic programming
LCS has optimal substructure and overlapping subproblems, so a DP table of size m x n solves it in O(mn).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
When a graph with V vertices and E edges is stored as adjacency lists, the time complexity of BFS or DFS is:
सही उत्तर: ग) O(V + E)
Each vertex is visited once and each adjacency list is scanned once, giving O(V + E).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Even in its worst case, heap sort sorts n elements in time:
सही उत्तर: क) O(n log n)
Building the heap takes O(n) and each of the n extract-max steps takes O(log n), so heap sort is O(n log n) in every case.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Merge sort on an array of n elements normally needs extra (auxiliary) memory of:
सही उत्तर: ख) O(n)
Standard array merge sort copies elements into a temporary array while merging, using O(n) extra space.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
With int a = 3, b = 5; what are the values after a ^= b; b ^= a; a ^= b; ?
सही उत्तर: घ) a = 5, b = 3
This is the XOR swap: a = 3^5 = 6, b = 5^6 = 3, a = 6^3 = 5, so the values are exchanged.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, the expression 7.5 % 2 produces:
सही उत्तर: घ) A compile-time error, because % needs integer operands
The % operator is defined only for integers in C; fmod() from math.h gives the floating-point remainder.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, the expression 5 + 2.5, where 5 is an int constant and 2.5 is a double constant, has type:
सही उत्तर: ख) double
In mixed arithmetic the int is converted to the wider type, so the result is a double (7.5).
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A C float (IEEE single precision) gives about how many significant decimal digits of precision?
सही उत्तर: ग) 6 to 7
A 24-bit significand corresponds to about 7 decimal digits; double gives about 15-16.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In C, with int a = -1; unsigned int b = 1; the comparison a < b evaluates to 0 (false) because:
सही उत्तर: क) a is converted to unsigned, becoming a very large value
The usual arithmetic conversions turn -1 into UINT_MAX when compared with an unsigned int, so a < b is false.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Assuming two's complement int, what does printf("%d", ~5); print?
सही उत्तर: ख) -6
In two's complement, ~x = -x - 1, so ~5 = -6.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।