Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions and answers in Algorithms
10
10 votes
4
4 answers
1.7k
1.7k views
GATE CSE 2026 | Set 1 | Question: 39
Let $G(V, E)$ be a simple, undirected, edge-weighted graph with unique edge weights.Which of the following statements about the minimum spanning trees (MST) of $G$ is/are...
TARGET_2027
1.7k
views
answered
4 hours
ago
Algorithms
gatecse-2026-set1
two-marks
algorithms
minimum-spanning-tree
multiple-selects
+
–
13
13 votes
6
answers
6 answers
1.4k
1.4k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 3 | Question: 9
Consider a standard Dijkstra algorithm that works as follows: The queue is initialized with the usual initial values.While Queue is not empty Step 1: Extract the minimum ...
giest
1.4k
views
answered
1 day
ago
Algorithms
goclasses_cs_algo_tw3
goclasses
algorithms
dijkstras-algorithm
two-marks
+
–
91
91 votes
10
10 answers
70.6k
70.6k views
GATE CSE 2019 | Question: 37
There are $n$ unsorted arrays: $A_1, A_2, \dots, A_n$. Assume that $n$ is odd.Each of $A_1, A_2, \dots, A_n$ contains $n$ distinct elements. There are no common elements ...
Santosh_Pathak
70.6k
views
answered
1 day
ago
Algorithms
gatecse-2019
algorithms
time-complexity
two-marks
+
–
53
53 votes
8
answers
8 answers
22.2k
22.2k views
GATE CSE 2004 | Question: 42
What does the following algorithm approximate? (Assume $m 1, \epsilon >0$).x = m; y = 1; While (x-y ϵ) { x = (x+y)/2; y = m/x; } print(x);$\log \, m$$m^2$$m^{\frac{1}{2...
hharish.spatil
22.2k
views
answered
1 day
ago
Algorithms
gatecse-2004
algorithms
identify-function
normal
+
–
61
61 votes
5
answers
5 answers
25.4k
25.4k views
GATE CSE 2020 | Question: 23
Consider a double hashing scheme in which the primary hash function is $h_1(k)= k \text{ mod } 23$, and the secondary hash function is $h_2(k)=1+(k \text{ mod } 19)$. Ass...
2005vedant2005
25.4k
views
answered
1 day
ago
Algorithms
gatecse-2020
numerical-answers
algorithms
hashing
one-mark
double-hashing
+
–
45
45 votes
6
6 answers
3.0k
3.0k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 3 | Question: 13
The following diagram shows the set of edges (in thick black lines) selected at some intermediate step of an MST algorithm. Lighter edges are not yet in MST. Assume that ...
giest
3.0k
views
answered
1 day
ago
Algorithms
goclasses_cs_algo_tw3
goclasses
algorithms
graph-algorithms
minimum-spanning-tree
two-marks
+
–
48
48 votes
3
3 answers
2.0k
2.0k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 3 | Question: 15
Given an undirected, weighted graph $\mathrm{G}$ with positive, integer edge weights, we want to find a path shortest path from $u$ to $v$ with the below condition.The co...
giest
2.0k
views
answered
2 days
ago
Algorithms
goclasses_cs_algo_tw3
goclasses
algorithms
dijkstras-algorithm
shortest-path
two-marks
+
–
63
63 votes
9
answers
9 answers
25.8k
25.8k views
GATE CSE 2024 | Set 1 | Question: 32
Consider the following recurrence relation:$T(n)=\left\{\begin{array}{c}\sqrt{n} T(\sqrt{n})+n \text { for } n \geq 1, \\ 1 \quad \text { for } n=1\end{array}\right.$Whic...
Mahboob
25.8k
views
answered
2 days
ago
Algorithms
gatecse-2024-set1
algorithms
recurrence-relation
two-marks
+
–
138
138 votes
19
answers
19 answers
81.6k
81.6k views
GATE CSE 2014 | Set 1 | Question: 39
The minimum number of comparisons required to find the minimum and the maximum of $100$ numbers is ________
TARGET_2027
81.6k
views
answered
3 days
ago
Algorithms
gatecse-2014-set1
algorithms
numerical-answers
normal
maximum-minimum
sorting
+
–
137
137 votes
19
answers
19 answers
46.4k
46.4k views
GATE CSE 2012 | Question: 39
A list of $n$ strings, each of length $n$, is sorted into lexicographic order using the merge-sort algorithm. The worst case running time of this computation is$O (n \log...
shanmukhagopagoni
46.4k
views
answered
3 days
ago
Algorithms
gatecse-2012
algorithms
sorting
normal
merge-sort
+
–
30
30 votes
6
answers
6 answers
2.8k
2.8k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 2 | Question: 10
Let $T(n)$ be$$T(n)= \begin{cases}2 T(n / 2)+8 T(n / 4)+n^{2} & \text { if } n \geq 4 \\1 & \text { if } n \leq 3\end{cases}$$What will be asymptotic bound on $T(n)?$ $\T...
Kayden Cat
2.8k
views
answered
5 days
ago
Algorithms
goclasses_cs_algo_tw2
goclasses
algorithms
recurrence-relation
asymptotic-notations
time-complexity
two-marks
+
–
33
33 votes
4
4 answers
19.6k
19.6k views
GATE CSE 2024 | Set 1 | Question: 31
An array $[82,101,90,11,111,75,33,131,44,93]$ is heapified. Which one of the following options represents the first three elements in the heapified array?$82,90,101$...
Gautam_Bhatt
19.6k
views
answered
5 days
ago
Algorithms
gatecse-2024-set1
algorithms
heap-sort
sorting
two-marks
+
–
119
119 votes
22
answers
22 answers
57.1k
57.1k views
GATE CSE 2016 | Set 1 | Question: 39
Let $G$ be a complete undirected graph on $4$ vertices, having $6$ edges with weights being $1, 2, 3, 4, 5,$ and $6$. The maximum possible weight that a minimum weight s...
ankit2024
57.1k
views
answered
Oct 1
Algorithms
gatecse-2016-set1
algorithms
minimum-spanning-tree
normal
numerical-answers
+
–
109
109 votes
13
answers
13 answers
39.4k
39.4k views
GATE CSE 2000 | Question: 2.17
Consider the following functions$f(n) = 3n^{\sqrt{n}}$$g(n) = 2^{\sqrt{n}{\log_{2}n}}$$h(n) = n!$Which of the following is true?$h(n)$ is $O(f(n))$$h(n)$ is $O(g(n))$$g(n...
AneeshS
39.4k
views
answered
Sep 29
Algorithms
gatecse-2000
algorithms
asymptotic-notations
normal
+
–
103
103 votes
7
answers
7 answers
31.6k
31.6k views
GATE CSE 2018 | Question: 43
Let $G$ be a graph with $100!$ vertices, with each vertex labelled by a distinct permutation of the numbers $1, 2,\ldots, 100.$ There is an edge between vertices $u$ and ...
devthedante
31.6k
views
answered
Sep 29
Algorithms
gatecse-2018
algorithms
graph-algorithms
numerical-answers
two-marks
strongly-connected-components
+
–
127
127 votes
11
answers
11 answers
33.4k
33.4k views
GATE CSE 2016 | Set 2 | Question: 41
In an adjacency list representation of an undirected simple graph $G=(V, E)$, each edge $(u, v)$ has two adjacency list entries: $[v]$ in the adjacency list of $u$, and $...
TARGET_2027
33.4k
views
answered
Sep 29
Algorithms
gatecse-2016-set2
algorithms
graph-algorithms
normal
+
–
0
0 votes
0
0 answers
74
74 views
Recurrence
Q.${Solve}$ ${Recurrence}$.$T(n) = T\left(\frac{n}{15}\right) + T\left(\frac{n}{10}\right) + 2T\left(\frac{n}{6}\right) + \sqrt{n}$
DΛΞMON
74
views
asked
Sep 29
Algorithms
recurrence-relation
algorithms
+
–
2
2 votes
2
2 answers
184
184 views
GO Classes CS Test Series | Algorithms | Subject Wise Test 3 | Question: 23
Which of the following statements is/are FALSE?If all edge weights of $\mathrm{G}=(\mathrm{V}, \mathrm{E})$ are distinct, the MST of a graph G is unique. Removing the max...
Asad Anis
184
views
answered
Sep 28
Algorithms
goclasses_cs_algo_sw3
goclasses
algorithms
multiple-selects
two-marks
+
–
24
24 votes
5
5 answers
2.4k
2.4k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 3 | Question: 7
Consider a source which outputs independent random letters from the alphabet $A=$ $\{a, b, c, d, e\}$ with probabilities $p_{a}=1 / 4, p_{b}=1 / 4, p_{c}=1 / 6, p_{d}=1 /...
Hustler
2.4k
views
answered
Sep 28
Algorithms
goclasses_cs_algo_tw3
goclasses
algorithms
huffman-code
two-marks
+
–
9
9 votes
4
4 answers
1.9k
1.9k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 4 | Question: 10
Find total number of scalar multiplications of a matrix-chain product of $6$ matrices whose sequence of dimensions is $5, 10, 3, 12, 5, 50$ and $6.$ That is $5\times 10$ ...
Pranav_Wankhede
1.9k
views
answered
Sep 23
Algorithms
goclasses_cs_algo_tw4
numerical-answers
goclasses
algorithms
matrix-chain-ordering
two-marks
+
–
60
60 votes
6
answers
6 answers
22.5k
22.5k views
GATE CSE 1991 | Question: 03,vi
Kruskal’s algorithm for finding a minimum spanning tree of a weighted graph $G$ with $n$ vertices and $m$ edges has the time complexity of:$O(n^{2})$$O(mn)$$O(m+n)$$O(m \...
sanketkh11
22.5k
views
answered
Sep 23
Algorithms
gate1991
algorithms
graph-algorithms
minimum-spanning-tree
time-complexity
multiple-selects
+
–
1
1 vote
1
1 answer
213
213 views
GATE@Zeal Basic DSA Searching and Sorting (Q24)
You have given an array A[] = {12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1}. An inversion in an array A is a pair of array indices (i, j) such that i < j and A[i] A[j]. Assume...
Loser_27
213
views
answered
Sep 22
Algorithms
insertion-sort
array-inversion
+
–
32
32 votes
7
7 answers
2.4k
2.4k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 2 | Question: 11
Select the correct asymptotic complexity of an algorithm with runtime $T(n, n)$ where$T(x, c)=\Theta(x) \quad$ for $c \leq 2$,$T(c, y)=\Theta(y) \quad$ for $c \leq 2$, an...
Pranav_Wankhede
2.4k
views
answered
Sep 22
Algorithms
goclasses_cs_algo_tw2
goclasses
algorithms
recurrence-relation
asymptotic-notations
time-complexity
two-marks
+
–
36
36 votes
4
4 answers
2.4k
2.4k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 2 | Question: 12
Consider mutually recursive definitions of $T(a, b)$ and $S(c, d)$ :$$\begin{array}{rlr}T(x, c) & =\Theta(x) & \text { for } c \leq 2 \\T(x, y) & =\Theta(x)+S(x, y / 2), ...
Pranav_Wankhede
2.4k
views
answered
Sep 22
Algorithms
goclasses_cs_algo_tw2
goclasses
algorithms
recurrence-relation
asymptotic-notations
time-complexity
two-marks
+
–
11
11 votes
4
4 answers
1.5k
1.5k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 4 | Question: 4
Let $X=x_{1} x_{2} \cdots x_{m}$ and $Y=y_{1} y_{2} \cdots y_{n}$ be two strings over the alphabet $\displaystyle{}\Sigma= \{\mathrm{A}, \mathrm{C}, \mathrm{G}, \mathrm{T...
Kartik_Sharma 2
1.5k
views
answered
Sep 22
Algorithms
goclasses_cs_algo_tw4
goclasses
algorithms
dynamic-programming
longest-common-subsequence
one-mark
+
–
23
23 votes
3
3 answers
1.6k
1.6k views
GO Classes CS Test Series | Algorithms | Topic Wise Test 4 | Question: 2
You are working on a dynamic programming problem defined by the recurrence:\[ A(i, j) = F\!\big( A(\lfloor i/2 \rfloor,\, j),\; A(i,\, \lfloor j/2 \rfloor) \big), \]where...
Kartik_Sharma 2
1.6k
views
answered
Sep 22
Algorithms
goclasses_cs_algo_tw4
goclasses
algorithms
dynamic-programming
recurrence-relation
one-mark
+
–
37
37 votes
4
4 answers
14.9k
14.9k views
GATE CSE 2025 | Set 2 | Question: 19
Which of the following statements regarding Breadth First Search (BFS) and Depth First Search (DFS) on an undirected simple graph $G$ is/are TRUE?A DFS tree of $G$ is...
saismrutiranjan18
14.9k
views
answered
Sep 21
Algorithms
gatecse2025-set2
algorithms
searching
breadth-first-search
depth-first-search
multiple-selects
one-mark
+
–
3
3 votes
1
1 answer
333
333 views
GO Classes DPP | GATE CS, DA | Algorithms | Directed Graph
Let $G$ be a directed graph with nonnegative edge weights, and let $s$ and $t$ be vertices of $G$.Consider the statement:Any shortest path from $s$ to $t$ in $G$ is also ...
GO Classes
333
views
asked
Aug 31
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-262
goclasses-cs-dpp
goclasses-cs-dpp-day-360
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
directed-graph
+
–
3
3 votes
1
1 answer
242
242 views
GO Classes DPP | GATE CS, DA | Algorithms | Quick Sort
During sorting, one complete processing of all elements whose final positions have not yet been determined is called a pass.Which of the following sequences cannot be the...
GO Classes
242
views
asked
Aug 31
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-262
goclasses-cs-dpp
goclasses-cs-dpp-day-360
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
quick-sort
+
–
3
3 votes
1
1 answer
171
171 views
GO Classes DPP | GATE CS, DA | Algorithms | Hashing
An initially empty hash table $\text{HT}$ has length $11$.The hash function is:$H(key)=key \bmod 7$Collisions are resolved using linear probing.The following keys are ins...
GO Classes
171
views
asked
Aug 31
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-262
goclasses-cs-dpp
goclasses-cs-dpp-day-360
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
hashing
+
–
3
3 votes
1
1 answer
219
219 views
GO Classes DPP | GATE CS, DA | Algorithms | Time Complexity
The algorithm $\text{ALGSORT}$ sorts an array of distinct integers using comparisons.The function $\text{MININDEX(V,i,j)}$ returns the position of the smallest element in...
GO Classes
219
views
asked
Aug 31
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-262
goclasses-cs-dpp
goclasses-cs-dpp-day-360
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
+
–
1
1 vote
1
1 answer
176
176 views
GO Classes DPP | GATE CS, DA | Algorithms | MST vs Shortest Path Tree
Consider the following statement:For every connected weighted graph $G$, there exists some vertex $v$ such that a shortest path tree rooted at $v$ is identical to a minim...
GO Classes
176
views
asked
Aug 29
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-261
goclasses-cs-dpp
goclasses-cs-dpp-day-359
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
minimum-spanning-tree
shortest-path
+
–
2
2 votes
1
1 answer
170
170 views
GO Classes DPP | GATE CS, DA | Algorithms | Bellman Ford
Consider a simple version of Bellman-Ford algorithm where we initialize $\text{distTo}[s]$ to $0$ and the rest of $\text{distTo}[v]$ to $+\infty$. Then fix an order on al...
GO Classes
170
views
asked
Aug 29
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-261
goclasses-cs-dpp
goclasses-cs-dpp-day-359
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
bellman-ford
+
–
1
1 vote
1
1 answer
164
164 views
GO Classes DPP | GATE CS, DA | Algorithms | Dijkstra's Algorithm
Consider Dijkstra's algorithm on a graph having $V$ vertices and $E$ edges.Suppose an indexed priority queue is not used.Instead, the tentative distances are stored only ...
GO Classes
164
views
asked
Aug 29
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-261
goclasses-cs-dpp
goclasses-cs-dpp-day-359
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
dijkstras-algorithm
+
–
1
1 vote
1
1 answer
117
117 views
GO Classes DPP | GATE CS, DA | Algorithms | Edge Relaxation
Consider a directed edge $e = v \to w$ with weight $7$. Suppose that during a shortest path algorithm:$\operatorname{distTo}[v] = 16$ and $\operatorname{distTo}[w] = 25$...
GO Classes
117
views
asked
Aug 29
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-261
goclasses-cs-dpp
goclasses-cs-dpp-day-359
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
edge-relaxation
+
–
1
1 vote
1
1 answer
154
154 views
GO Classes DPP | GATE CS, DA | Algorithms | Time Complexity
Suppose Huffman coding is implemented as follows.Initially, the $n$ symbols are stored in a min priority queue according to their frequencies.The algorithm repeatedly per...
GO Classes
154
views
asked
Aug 29
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-261
goclasses-cs-dpp
goclasses-cs-dpp-day-359
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
huffman-coding
greedy-algorithms
priority-queue
+
–
1
1 vote
1
1 answer
162
162 views
GO Classes DPP | GATE CS, DA | Algorithms | MST
Let, $G=(V,E)$ be a connected undirected graph. Edge weights may be negative.We want to choose, $E'\subseteq E$ such that $G'=(V,E')$ is connected and: $\sum_{e\in E'}w(e...
GO Classes
162
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-260
goclasses-cs-dpp
goclasses-cs-dpp-day-358
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
minimum-spanning-tree
+
–
0
0 votes
1
1 answer
161
161 views
GO Classes DPP | GATE CS, DA | Algorithms | Dijkstra's Algorithm
Let $G=(V,E)$ be a directed graph with positive edge weights.Given vertices $s,w,t$ we want the length of the shortest path from $s$ to $t$ that must pass through $w$.Con...
GO Classes
161
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-260
goclasses-cs-dpp
goclasses-cs-dpp-day-358
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
dijkstras-algorithm
+
–
2
2 votes
1
1 answer
130
130 views
GO Classes DPP | GATE CS, DA | Algorithms | Floyd-Warshall
What is the primary reason to use Floyd's algorithm for the all-pairs shortest-path problem instead of Dijkstra's algorithm?Faster for dense graphs. Faster for sparse gra...
GO Classes
130
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-260
goclasses-cs-dpp
goclasses-cs-dpp-day-358
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
floyd-warshall-algorithm
dijkstras-algorithm
+
–
1
1 vote
1
1 answer
207
207 views
GO Classes DPP | GATE CS, DA | Algorithms | Binary Search
Which of the following cannot be a sequence of keys compared during a binary search for some target key?$500,200,450,180$ $500,450,200,180$ $180,500,200,450$ $180,200,500...
GO Classes
207
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-260
goclasses-cs-dpp
goclasses-cs-dpp-day-358
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
binary-search
+
–
To see more, click for all the
questions in this category
.