Skip to content
Early access — you're among the first to try PYQLabs. Share feedback
Concept drill

Dynamic Programming

GATE CSE & IT · Algorithms - Array Sorting · 1990-2026

25
PYQs
84%
keyed
4
elite explanations
15
years appeared

Study anchor

Source-book anchor pending for this concept.

Practice action

Start latest PYQ

PYQs in this concept

All concepts →
2026 PYQ

Let $G(V, E)$ be an undirected, edge-weighted graph with integer weights. The weight of a path is the sum of the weights of the edges in that path. The length of a path is the numb...

mediumanswer keyelite explanation
2024 Q35

Let A be an array containing integer values. The distance of A is defined as the minimum number of elements in A that must be replaced with another integer so that the resulting ar...

mediumanswer key
2024 PYQ

Let $A$ be an array containing integer values. The distance of $A$ is defined as the minimum number of elements in $A$ that must be replaced with another integer so that the result...

mediumbasic explanation
2021 PYQ

Define R n to be the maximum amount earned by cutting a rod of length n meters into one or more pieces of integer length and selling them. For i > 0, let p[i] denotes the selling p...

mediumanswer keybasic explanation
2018 PYQ

Assume that multiplying a matrix $${G_1}$$ of dimension $$p \times q$$ with another matrix $${G_2}$$ of dimension $$q \times r$$ requires $$pqr$$ scalar multiplications. Computing...

mediumanswer key
2016 PYQ

Let $${A_1},\,{A_2},\,{A_3}$$ and $${A_4}$$ be four matrices of dimensions $$10 \times 5,\,5 \times 20,\,20 \times 10,$$ and $$10 \times 5,$$ respectively. The minimum number of sc...

medium
2016 PYQ

The Floyd-Warshall algorithm for all-pair shortest paths computation is based on

easyanswer key
2016 PYQ

Let $${A_1},{A_2},{A_3},$$ and $${A_4}$$ be four matrices of dimensions $$10 \times 5,\,\,5 \times 20,\,\,20 \times 10,$$ and $$10 \times 5,\,$$ respectively. The minimum number of...

medium
2015 PYQ

Given below are some algorithms, and some algorithm design paradigms. GROUP 1 GROUP 2 1. Dijkstra's Shortest Path i. Divide and Conquer 2. Floyd-Warshall algorithm to compute all p...

easyanswer key
2015 PYQ

Match the following: List 1 (P) Prim’s algorithm for minimum spanning tree (Q) Floyd-Warshall algorithm for all pairs shortest paths (R) Mergesort (S) Hamiltonian circuit List 2 (i...

easyanswer key
2011 PYQ

Four matrices M 1 , M 2 , M 3 and M 4 of dimensions p $$\times$$ q, q $$\times$$ r, r $$\times$$ s and s $$\times$$ t respectively can be multiplied is several ways with different...

mediumanswer key
2011 PYQ

An algorithm to find the length of the longest monotonically increasing sequence of numbers in an array A[0:n−1] is given below. Let L i , denote the length of the longest monotoni...

easyanswer key
2011 PYQ

Four matrices $${M_1},\,\,\,{M_2},\,\,\,{M_3}$$ and $${M_4}$$ of dimensions $$p\,\,x\,\,q,\,\,\,\,\,q\,\,x\,\,e,\,\,\,\,\,r\,\,x\,\,s$$ and $$\,\,\,\,s\,\,x\,\,t$$ respectively can...

mediumanswer key
2009 PYQ

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n, respe...

easyanswer key
2009 PYQ

A sub-sequence of a given sequence is just the given sequence with some elements (possibly none or all) left out. We are given two sequences X[m] and Y[n] of lengths m and n, respe...

mediumanswer key
2008 PYQ

The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a 1 ,a 2 ,a 3 ,…,a n } and positive integer W, is there a subset of S whose elements sum to W...

easyanswer key
2008 PYQ

Consider the following C functions: int f1(int n){ if(n == 0 || n == 1){ return n; } return (2 * f1(n - 1) + 3 * f1(n - 2)); } int f2(int n){ int i; int X[N], Y[N], Z[N]; X[0] = Y[...

mediumanswer keyelite explanation
2008 PYQ

The subset-sum problem is defined as follows. Given a set of n positive integers, S = {a 1 ,a 2 ,a 3 ,…,a n } and positive integer W, is there a subset of S whose elements sum to W...

mediumanswer key
2008 PYQ

Consider the following C functions: int f1(int n){ if(n == 0 || n == 1){ return n; } return (2 * f1(n - 1) + 3 * f1(n - 2)); } int f2(int n){ int i; int X[N], Y[N], Z[N]; X[0] = Y[...

easyanswer keyelite explanation
2005 PYQ

Consider the following C - function: double foo(int n){ int i; double sum; if(n == 0) return 1.0; sum = 0.0; for (i = 0; i < n; i++){ sum += foo(i); } return sum; } Suppose we modi...

easyanswer keyelite explanation
2003 PYQ

Let G = (V, E) be a directed graph with n vertices. A path from v i to v j in G is sequence of vertices (v i , v i +1, ……., v j ) such that (v k , v k +1) ∈ E for all k in i throug...

hardanswer key
1998 PYQ

Which one of the following algorithm design techniques is used in finding all pairs of shortest distances in a graph?

easyanswer key
1994 PYQ

Which one of the following statements is false?

easyanswer key
1991 PYQ

Obtain the optimal binary search tree with equal probabilities for the identifier set (a 1 , a 2 , a 3 ) = ( if, stop, while)

medium
1990 PYQ

Match the pairs in the following: List - I (a) Straseen's matrix multiplication algorithm (b) Kruskal's minimum spanning tree algorithm (c) Bioconnected components algorithm (d) Fl...

easyanswer key