Login
Register
Dark Mode
Brightness
Ambient Glow – Questions list
Register
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
1
1 vote
1
1 answer
235
235 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
235
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
+
–
2
2 votes
1
1 answer
161
161 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
161
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
107
107 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
107
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
+
–
2
2 votes
1
1 answer
137
137 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
137
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
121
121 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
121
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
112
112 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
112
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
108
108 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
108
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
76
76 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
76
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
99
99 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
99
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
108
108 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
108
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
103
103 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
103
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
89
89 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
89
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
+
–
0
0 votes
1
1 answer
137
137 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
137
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
+
–
0
0 votes
1
1 answer
75
75 views
GO Classes DPP | GATE CS, DA | Algorithms | Time Complexity
Consider,f1(N): x = 0 for i = 0 to N - 1: x++ return xand,f2(N, R): x = 0 for i = 0 to N - 1: for j = 1; j <= R; j = j + j: x = x + f1(j) return xWhat is the order of gro...
GO Classes
75
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
time-complexity
+
–
1
1 vote
1
1 answer
122
122 views
GO Classes DPP | GATE CS, DA | Algorithms | Dijkstra's Algorithm
Let $G$ be a directed graph with nonnegative edge weights.Run Dijkstra's algorithm from source $s$. After the algorithm terminates, use the $\text{prev}$ pointers to cons...
GO Classes
122
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-259
goclasses-cs-dpp
goclasses-cs-dpp-day-357
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
hashing
dijkstras-algorithm
+
–
0
0 votes
1
1 answer
94
94 views
GO Classes DPP | GATE CS, DA | Algorithms | Minimum Spanning Tree
Consider the following statements.Let $M$ be an MST of a connected undirected graph with positive edge weights. If $7$ is added to every edge weight, $M$ is guaranteed to...
GO Classes
94
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-259
goclasses-cs-dpp
goclasses-cs-dpp-day-357
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
minimum-spanning-tree
+
–
1
1 vote
1
1 answer
87
87 views
GO Classes DPP | GATE CS, DA | Algorithms | Bellman-Ford
Consider the following directed weighted graph with source vertex $0$:Bellman-Ford performs one complete pass, relaxing edges in this exact order:$$0\rightarrow1,\quad 0\...
GO Classes
87
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-259
goclasses-cs-dpp
goclasses-cs-dpp-day-357
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
bellman-ford
multiple-selects
+
–
2
2 votes
1
1 answer
126
126 views
GO Classes DPP | GATE CS, DA | Algorithms | Analysis of Algorithms
The following running times are observed for a program:$$\begin{array}{|c|c|}\hlineN & \text{Running time} \\\hline1000 & 0.1\text{ seconds} \\2000 & 0.3\text{ seconds} \...
GO Classes
126
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-259
goclasses-cs-dpp
goclasses-cs-dpp-day-357
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
numerical-answers
+
–
0
0 votes
1
1 answer
87
87 views
GO Classes DPP | GATE CS, DA | Algorithms | Linear Probing
A linear-probing hash table of length $10$ uses:$h(k) = k \bmod 10$After inserting eight keys into an initially empty table, the table is:$$\begin{array}{|c|c|c|c|c|c|c|c...
GO Classes
87
views
asked
Aug 26
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-259
goclasses-cs-dpp
goclasses-cs-dpp-day-357
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
hashing
linear-probing
multiple-selects
+
–
1
1 vote
1
1 answer
115
115 views
GO Classes DPP | GATE CS, DA | Algorithms | Minimum Spanning Tree
Let $G=(V,E)$ be a connected weighted undirected graph in which all edge weights are distinct.Let, $e=(u,v)$ be an edge of weight $w(e)$.Construct a graph $G'$ containing...
GO Classes
115
views
asked
Aug 25
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-258
goclasses-cs-dpp
goclasses-cs-dpp-day-356
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
minimum-spanning-tree
+
–
0
0 votes
1
1 answer
92
92 views
GO Classes DPP | GATE CS, DA | Algorithms | Sorting Complexity
Let $P$ be the problem of sorting $n\geq1$ elements using only comparisons.Consider the class of all comparison-based algorithms that correctly solve $P$.What is the asym...
GO Classes
92
views
asked
Aug 25
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-258
goclasses-cs-dpp
goclasses-cs-dpp-day-356
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
sorting
time-complexity
+
–
0
0 votes
1
1 answer
100
100 views
GO Classes DPP | GATE CS, DA | Algorithms | Hash Collision Handling
When hashing is used for table addressing, a collision-resolution method is generally required.Why?Collision handling is required only when the table is completely full. ...
GO Classes
100
views
asked
Aug 25
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-258
goclasses-cs-dpp
goclasses-cs-dpp-day-356
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
hashing
collision
+
–
0
0 votes
1
1 answer
117
117 views
GO Classes DPP | GATE CS, DA | Algorithms | Asymptotic Analysis
Let $T_A(n)$ and $T_B(n)$ denote the worst-case running times of two algorithms $A$ and $B$ that solve the same problem.We say that $A$ is asymptotically more efficient t...
GO Classes
117
views
asked
Aug 25
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-258
goclasses-cs-dpp
goclasses-cs-dpp-day-356
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
asymptotic-notations
+
–
0
0 votes
1
1 answer
70
70 views
GO Classes DPP | GATE CS, DA | Algorithms | Dijkstra's Algorithm
Suppose every edge weight of a graph is either:a positive integer, or exactly $-1$.Consider the statement:Dijkstra's algorithm will always compute the correct shortest-pa...
GO Classes
70
views
asked
Aug 25
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-258
goclasses-cs-dpp
goclasses-cs-dpp-day-356
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
dijkstras-algorithm
+
–
3
3 votes
1
1 answer
157
157 views
GO Classes DPP | GATE CS, DA | Algorithms | Dijkstra's Algorithm
Consider the following code executed while processing vertex $v$:for each edge e in G.adj(v): w = e.to() if dist[w] dist[v] + e.weight(): dist[w] = dist[v] + e.weight() ...
GO Classes
157
views
asked
Aug 24
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-257
goclasses-cs-dpp
goclasses-cs-dpp-day-355
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
dijkstras-algorithm
+
–
4
4 votes
1
1 answer
102
102 views
GO Classes DPP | GATE CS, DA | Algorithms | Minimum Spanning Trees
Consider the statement:The minimum spanning tree of a connected weighted graph $G$ is unique if and only if all edge weights in $G$ are distinct.True False
GO Classes
102
views
asked
Aug 24
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-257
goclasses-cs-dpp
goclasses-cs-dpp-day-355
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
minimum-spanning-tree
+
–
1
1 vote
1
1 answer
123
123 views
GO Classes DPP | GATE CS, DA | Algorithms | Divide & Conquer
Consider three recursive algorithms.Algorithm $\mathbf{1}$Divides a problem of size $N$ into two subproblems of size $N/2$ and performs constant additional work.$T_1(N)=2...
GO Classes
123
views
asked
Aug 24
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-257
goclasses-cs-dpp
goclasses-cs-dpp-day-355
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
divide-and-conquer
+
–
2
2 votes
1
1 answer
99
99 views
GO Classes DPP | GATE CS, DA | Algorithms | Selection Algorithms
Let, $L=\langle r_1,r_2,\ldots,r_n\rangle$ be an arbitrary list of integers, not necessarily distinct.Which of the following statements is incorrect?There exists an optim...
GO Classes
99
views
asked
Aug 24
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-257
goclasses-cs-dpp
goclasses-cs-dpp-day-355
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
+
–
2
2 votes
1
1 answer
98
98 views
GO Classes DPP | GATE CS, DA | Algorithms | Complexity Analysis
Consider the following recursive function $\texttt{Pot}$, which computes $x^n$, where $x$ is real and $n$ is an integer.Pot(x, n): if x == 0: return 0 if n == 0: return 1...
GO Classes
98
views
asked
Aug 24
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-257
goclasses-cs-dpp
goclasses-cs-dpp-day-355
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
time-complexity
+
–
2
2 votes
1
1 answer
118
118 views
GO Classes DPP | GATE CS, DA | Algorithms | Dynamic Programming
True or False:In every dynamic-programming solution, the asymptotic space requirement must be at least as large as the total number of distinct subproblems.True False
GO Classes
118
views
asked
Aug 22
Algorithms
goclasses
goclasses-da-dpp
goclasses-da-dpp-day-256
goclasses-cs-dpp
goclasses-cs-dpp-day-354
algorithms
python-&-dsa
goclasses-python-&-dsa-practice-questions
goclasses-algo-practice-questions
dynamic-programming
numerical-answers
+
–
Page:
1
2
3
4
5
6
...
150
next »