Computer Science Test 8 Nddc Scholarship

Computer Science Test 8 Nddc Scholarship
Available Sections
2. Career
4. Job
1...67891011

Question 71

The Sieve Technique is introduced as an important illustration of a special case of:
Show explanation Expand Question
The Sieve Technique is often categorized as 'Decrease and Conquer'. While 'Divide and Conquer' splits a problem into multiple sub-problems, Decrease and Conquer reduces the original problem to a single smaller sub-problem. The Sieve technique is the 'Prune and Search' variation of this, where we prune a constant fraction of the input in each step, making it a distinct and highly effective strategy for selection and optimization problems.
Not clear enough?

Question 72

In a complete binary tree of height \(h\), what is the total number of nodes?
Show explanation Expand Question
In a binary tree, the number of nodes at any level \(i\) is \(2^i\). In a complete (full) binary tree, every level is filled. The total number of nodes is the sum of a geometric progression from level 0 to level \(h\):\[ \sum_{i=0}^{h} 2^i = 2^{h+1} - 1 \] For example, a tree of height 2 has \(2^{2+1} - 1 = 7\) nodes (1 at root, 2 at level 1, 4 at level 2).
Not clear enough?

Question 73

The Sieve Technique applies to problems where we are interested in finding a single item from a larger set of ____________.
Show explanation Expand Question
The Sieve Technique is designed for 'selection' problems where the goal is to pinpoint one specific element (like the median or the smallest value) out of a collection of '\(n\) items'. By using a strategy to identify and discard large groups of items that are guaranteed not to be the target, the algorithm narrows down the search space until only the single desired item remains.
Not clear enough?

Question 74

What is the definition of 'Memoization' in the context of algorithm optimization?
Show explanation Expand Question
Memoization is an optimization technique used primarily to speed up computer programs by storing the results of expensive function calls and returning the cached result when the same inputs occur again. In recursion, many problems (like the Fibonacci sequence) recalculate the same values thousands of times. Memoization 'remembers' the result of each recursive call by writing it in a table (usually an array or hash map), effectively turning an exponential-time problem into a linear-time one.
Not clear enough?

Question 75

Which of the following sorting algorithms or complexities is generally considered the fastest for large-scale data sets?
Show explanation Expand Question
While \(O(n \log n)\) is the fastest complexity for comparison-based sorts (like Mergesort), algorithms that use non-comparison methods—such as Counting Sort—can achieve a complexity of \(O(n + k)\), where \(k\) is the range of the input. In cases where \(k\) is relatively small, \(O(n + k)\) is theoretically faster as it is linear, outperforming even the highly efficient \(O(n \log n)\) algorithms.
Not clear enough?

Question 76

Which of the following best describes the characteristics of the Quick Sort algorithm?
Show explanation Expand Question
Quick Sort is known as an 'in-place' algorithm because it requires only a small, constant amount of extra storage space beyond the initial array (specifically for the recursion stack). However, it is 'not stable'. A stable sort preserves the relative order of equal elements; because Quick Sort partitions elements by swapping them across long distances relative to a pivot, it frequently changes the relative order of identical elements.
Not clear enough?

Question 77

Which of the following is a classic example of a sorting algorithm that is 'in-place' but 'not stable'?
Show explanation Expand Question
Quick Sort is the quintessential example of an in-place but unstable sorting algorithm. It sorts by partitioning the array around a pivot, using swaps to move elements to their correct side. These swaps can jump equal elements over each other, destroying their original relative order. In contrast, Merge Sort is stable but not in-place (requires extra memory), and Bubble Sort is both stable and in-place but very slow.
Not clear enough?

Question 78

An in-place sorting algorithm is defined as one that uses __________ for storage during the execution of the sorting process.
Show explanation Expand Question
An 'in-place' algorithm is one that transforms input using no auxiliary data structure. Although a small amount of extra storage is allowed for auxiliary variables (typically \(O(1)\) or \(O(\log n)\) for the recursion stack), the algorithm does not require an 'additional array' to hold a copy of the data. This makes in-place algorithms like Quick Sort or Heap Sort highly memory-efficient compared to algorithms like Merge Sort, which requires an entirely separate array to perform the merging process.
Not clear enough?

Question 79

Which of the following sorting algorithm time complexities is generally considered the fastest for a large number of inputs (assuming the value of k is relatively small)?
Show explanation Expand Question
While \(O(n \log n)\) is the fastest possible time complexity for comparison-based sorting algorithms, non-comparison sorts like Counting Sort can achieve a linear time complexity of \(O(n + k)\). In scenarios where the range of input values (\(k\)) is not significantly larger than the number of elements (\(n\)), \(O(n + k)\) is mathematically faster than \(O(n \log n)\) because it does not involve the logarithmic factor required by comparisons.
Not clear enough?

Question 80

The actual running time and efficiency of the Quick Sort algorithm depend heavily on the selection of which of the following?
Show explanation Expand Question
The performance of Quick Sort is dictated by how evenly the 'pivot elements' partition the array. If a pivot consistently splits the array into two nearly equal halves, the algorithm achieves its best-case complexity of \(O(n \log n)\). However, if the pivot selection is poor (e.g., always picking the smallest or largest element in an already sorted array), the partitions become highly unbalanced, causing the algorithm to degrade to its worst-case performance of \(O(n^2)\).
Not clear enough?

1...67891011
In this page
Computer-science test-8 Nddc Scholarship
Open Model!