प्रोग्रामिङ – Programming MCQ
प्रोग्रामिङ – कम्प्युटर र IT
Programming · Computer & IT (Technical) · १,५६५ प्रश्न
१,५६५ प्रश्न उपलब्ध। मोड छान्नुहोस्:
प्रोग्रामिङ: प्रश्न र उत्तर
सही लागेको विकल्पमा थिच्नुहोस्। सही भए हरियो, गलत भए रातो देखिन्छ; ३ सेकेन्डपछि सही उत्तर र व्याख्या देखिन्छ।
सही: ० / ०
-
What is the amortised time complexity of appending an element at the end of a dynamic array (such as a Python list or C++ vector) that doubles its capacity when full?
सही उत्तर: क) O(1)
Occasional O(n) resizes are spread over many cheap appends, so the average (amortised) cost per append is constant.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Bubble sort (ascending) is applied to [4, 3, 2, 1]. What is the array after the first two passes?
सही उत्तर: ख) [2, 1, 3, 4]
Pass 1 bubbles 4 to the end: [3, 2, 1, 4]; pass 2 bubbles 3 into place: [2, 1, 3, 4].
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Selection sort (ascending, swapping the minimum of the unsorted part to the front) is applied to [64, 25, 12, 22, 11]. What is the array after the first two passes?
सही उत्तर: ग) [11, 12, 25, 22, 64]
Pass 1 swaps 11 with 64; pass 2 swaps the next minimum 12 with 25.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
The 8-bit pattern 11111111 represents which values when read as an unsigned number and as a signed two's complement number respectively?
सही उत्तर: क) 255 and -1
As unsigned it is 2^8 - 1 = 255; in two's complement an all-ones pattern is -1.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the decimal value of the binary number 1101.101?
सही उत्तर: घ) 13.625
1101 = 13 and .101 = 1/2 + 0/4 + 1/8 = 0.625, so the value is 13.625.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the edit (Levenshtein) distance between the words kitten and sitting, using insertions, deletions and substitutions?
सही उत्तर: ग) 3
k->s (substitute), e->i (substitute) and insert g at the end: 3 operations.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
What is the length of the longest common subsequence of the strings ABCB and BDCAB?
सही उत्तर: ख) 3
BCB is a common subsequence of length 3, and no common subsequence of length 4 exists.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
Using unlimited coins of 1 and 2 rupees, in how many different ways (ignoring order) can an amount of 5 rupees be made?
सही उत्तर: घ) 3
The combinations are 1+1+1+1+1, 1+1+1+2 and 1+2+2.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
In how many different ways can a person climb a staircase of 5 steps if each move is either 1 step or 2 steps?
सही उत्तर: क) 8
ways(n) = ways(n-1) + ways(n-2) with ways(0) = ways(1) = 1, giving 1, 1, 2, 3, 5, 8.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
-
A directed graph has the edges A->B, A->C, B->C, C->A and D->C. What is the in-degree of vertex C?
सही उत्तर: ग) 3
Three edges end at C: A->C, B->C and D->C.
💬 टिप्पणी / गल्ती रिपोर्ट (०)
यी अभ्यास प्रश्न हुन्, आधिकारिक प्रश्न होइनन्। पाठ्यक्रम, विज्ञापन र नतिजाका लागि सम्बन्धित निकायको आधिकारिक वेबसाइट हेर्नुहोस्। उत्तरमा गल्ती भेटे प्रश्नमुनिको "टिप्पणी / गल्ती रिपोर्ट" मा लेख्नुहोस्।
नमस्ते! पाठ्यक्रम, सामान्य ज्ञान, भाषा परीक्षा वा कुनै प्रश्नको उत्तर बुझ्न सोध्नुहोस्।
AI ले गल्ती गर्न सक्छ। महत्वपूर्ण कुरा आधिकारिक स्रोतमा जाँच्नुहोस्।