A custom currency system uses the coin denominations
. A student applies the
standard greedy strategy (always choosing the largest possible coin denomination that does not
exceed the remaining target amount) to make change for a target value of
.
What is the smallest integer target value
for which this greedy strategy fails to find the
optimal solution (i.e., it returns a strictly greater number of coins than the absolute minimum
required)?
A published solution is not available for this question yet.
, respectively.
If you execute a standard deletion operation to remove the root node
, which of the following
keys can cleanly replace the root position to keep the structural properties of the BST intact
without requiring major reorganization?
A.
3 or 18
B.
5 or 15
C.
7 or 12
D.
3 or 7
A published solution is not available for this question yet.
A boutique bakery produces specialty gift baskets containing boxes of Artisan Cookies (
) and
Gourmet Chocolates (
). For production, the kitchen has 800 kg of premium flour and 1200 kg of
refined sugar available in their inventory.
• Each box of Cookies (
) requires 2 kg of flour and 1 kg of sugar.
• Each box of Chocolates (
) requires 1 kg of flour and 3 kg of sugar.
The profit is fixed at Rs. 150 per box of cookies and Rs. 200 per box of chocolates. The objective
function is to maximize total profit
.
Which of the following is not a valid constraint for this linear programming problem?
A.B.C.D.
A published solution is not available for this question yet.
Which of the following statements is/are **true** about quicksort?
A.
The partitioning step requires a single linear scan of the subarray, taking
time
B.
If the input array is already sorted in strictly increasing order and we choose
the first element as the pivot, this partitioning scheme will split the array into two heavily
unbalanced subarrays of sizes roughly
and
C.
In the worst-case scenario, the partitioning step itself degrades and requires
time to complete.
D.
Quicksort always runs in
time, regardless of the order of the input
elements and the pivot-selection strategy.
E.
Quicksort and binary search are both examples of divide and conquer
algorithms.
A published solution is not available for this question yet.
Which of the following statements is/are **false** regarding the topological sorting of a graph? (Select
all that apply)
A.
Every Directed Acyclic Graph (DAG) must contain at least one vertex with an in-
degree of
and at least one vertex with an out-degree of
.
B.
A directed graph can have a valid topological sort if and only if it does not
contain any directed cycles.
C.
If we reverse the direction of every single edge in a DAG, the topological sort
sequence of the new reversed graph will remain exactly identical to the original graph's sequence.
D.
To find a topological sort using Depth-First Search (DFS), a vertex is added to
the final ordering sequence the moment it is first discovered (at its discovery time
).
E.
If a directed graph contains a single connected component, it is guaranteed to
have exactly one unique topological sort.
A published solution is not available for this question yet.
In the standard Inversion Count problem, a pair of numbers in an array is called an **"inversion"** if
a larger number appears before a smaller number.
If we have the array
, which pair of numbers forms a valid inversion?
A.
(4, 1)
B.
(8, 5)
C.
(8, 7)
D.
(7, 5)
E.
(5, 4)
A published solution is not available for this question yet.