The N-Queens problem asks to place N queens on an N×N board such that no two queens attack each other. Which paradigm is most naturally used?
GATE CSE · Algorithms
Generate diverse GATE-level questions covering overlapping subproblems, optimal substructure, memoization, tabulation, and state transition design.
118 questions · 0 PYQs · 20 AI practice · GATE CSE 2027
The N-Queens problem asks to place N queens on an N×N board such that no two queens attack each other. Which paradigm is most naturally used?
Which pruning strategy in backtracking for the 0/1 Knapsack problem cuts branches where the remaining items cannot improve the current best solution even if added fractionally?
Consider a backtracking solution for generating all permutations of n distinct elements. How many nodes does the state-space tree contain?
In the Hamiltonian Cycle problem solved via backtracking on a graph with n vertices, the worst-case number of partial paths explored is:
In the graph colouring problem using backtracking, we try to colour a graph with at most colours such that no two adjacent vertices share the same colour. For a graph with vertices and colours, what is the worst-case number of nodes in the state space tree?
The number of distinct ways to make change for amount n using coins of denominations {1, 2, 5} is computed using DP. The recurrence is dp[i] = sum of dp[i - c] for each coin c ≤ i, with dp[0] = 1. How many ways are there to make change for n = 4 using coins {1, 2}?
What is the minimum number of nodes that need to be explored by the branch and bound algorithm when applied to find the minimum value of the function f(x) = x^2 in the interval [0, 10]?
In Branch and Bound for maximization problems, what is the pruning condition using the upper bound UB(node) and the current best solution value Z*?
In backtracking, the bounding function is used to:
In the Branch and Bound algorithm for the Travelling Salesman Problem (TSP), a commonly used lower bound is computed using which technique?
In the N-Queens problem, we place queens on an chessboard such that no two queens attack each other. Using backtracking, what is the worst-case number of nodes explored in the state space tree?
The 4-Queens problem asks to place 4 queens on a board such that no two queens are in the same row, column, or diagonal. How many distinct solutions exist for the 4-Queens problem?
A Branch and Bound algorithm for 0/1 Knapsack processes the following search tree nodes in best-first order. Given items (v=10,w=5), (v=6,w=3), (v=4,w=2), capacity W=7. The upper bound at the root is computed as:
Select one or more correct options which explain why branch and bound is often preferable to backtracking for optimization problems.
Backtracking differs from dynamic programming in which of the following ways?
In backtracking for the Hamiltonian path problem on the following graph: Vertices , edges . Starting from vertex , how many distinct Hamiltonian paths start at vertex ?
Which of the following are TRUE about the relationship between Branch and Bound and the A* search algorithm?
Consider a graph with vertices and edges . Using backtracking, what is the minimum number of colours needed to colour this graph (chromatic number)?
In the 0/1 Knapsack problem, there are 3 items with weights [2, 3, 4] and values [3, 4, 5], and the knapsack capacity is 5. What is the maximum value achievable?
In the matrix chain multiplication problem, for n matrices, the number of different possible parenthesizations is:
Want unlimited AI-generated Dynamic Programming questions?
Sign up free and practice with adaptive difficulty — Easy, Medium, Hard. New questions every session.
Start practising for free →