Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage for Algorithms
Recent questions tagged algorithms
665
views
2
answers
4
votes
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 18
Bob writes down a number between 1 and 1,000. Mary must identify that number by asking "yes/no" questions of Bob. Mary knows that Bob always tells the ... that answer at the end of exactly how many questions on the worst case?9995003210
GO Classes
665
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
binary-search
1-mark
+
–
572
views
1
answers
4
votes
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 19
Which of the following frequencies for A,B,C and D can generate the following Huffman tree? (Select all that apply.)$p_A=0.4, p_B=0.3, p_C=0.2, p_D=0.1$p_A=0.35, p_B=0.25, ... .25, p_C=0.25, p_D=0.25$p_A=0.2, p_B=0.35, p_C=0.2, p_D=0.25$
GO Classes
572
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
huffman-code
multiple-selects
1-mark
+
–
705
views
2
answers
2
votes
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 20
Consider the following array$: [32, 33, 5, 2, 14, -4, 22, 39, 34, -9].$ We apply a certain sorting algorithm and observe that the ... applied?Merge sort (top-down approach)Bubble sortQuicksort (Using First element as pivot)Insertion sort
GO Classes
705
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
sorting
merge-sort
multiple-selects
1-mark
+
–
509
views
1
answers
5
votes
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 46
We have a procedure $P(n)$ that makes multiple calls to a procedure $Q(m)$, and runs in polynomial time in $n$. Unfortunately, a significant flaw was discovered in $Q(m)$ ... time in $n$ if, for each call $Q(m),m \underline<\log \;n.$
GO Classes
509
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
asymptotic-notation
time-complexity
2-marks
+
–
336
views
1
answers
3
votes
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 47
A $\text{stable sort}$ ...
GO Classes
336
views
GO Classes
asked
Feb 5
Algorithms
goclasses2024-mockgate-14
algorithms
sorting
2-marks
+
–
169
views
0
answers
0
votes
Memory Based GATE DA 2024 | Question: 18
Consider a directed acyclic graph (DAG) with vertices labeled as P, Q, R, S, T, U, and V. Which of the following sequences represents a possible topological sort of the graph?PRQVSUTPQRSVUTPQRSTUVPRQSVUT
GO Classes
169
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
graph-algorithms
topological-sort
+
–
227
views
0
answers
1
votes
Memory Based GATE DA 2024 | Question: 19
Consider the function \(f(n)\), which represents the maximum number of comparisons in binary search on a sorted array of size \(n\). Which of the following recursive ... \left(\lfloor \frac{n}{2} \rfloor\right) + 1\) None of the above
GO Classes
227
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
binary-search
recurrence-relation
+
–
190
views
0
answers
0
votes
Memory Based GATE DA 2024 | Question: 22
Given the array \( [4, 3, 2, 1, 5] \), which of the following sorting algorithms can successfully sort the array in exactly two passes?Bubble SortInsertion Sort Selection SortMerge Sort
GO Classes
190
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
sorting
+
–
378
views
1
answers
1
votes
Memory Based GATE DA 2024 | Question: 25
Consider the QuickSort algorithm with the last element chosen as the pivot. If the goal is to sort the given array \(a = [30, 40, 50, 60, 70, 80]\) in ascending order, how many swaps will occur during the execution of the algorithm?
GO Classes
378
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
quick-sort
numerical-answers
+
–
283
views
0
answers
0
votes
Memory Based GATE DA 2024 | Question: 27
Consider performing Depth-First Search (DFS) on an undirected and unweighted graph $\bar{G}$ starting at vertex $S$. For any vertex $u$ in $G$, where $d[u]$ ... DFS, the edge $(u, v)$ becomes:A forward edgeA back edgeA cross edgeA tree edge
GO Classes
283
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
graph-algorithms
depth-first-search
+
–
202
views
0
answers
0
votes
Memory Based GATE DA 2024 | Question: 34
BFS DFS question asking the number of nodes expanded BFS = DFSBFS $ DFSNone
GO Classes
202
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
graph-algorithms
depth-first-search
breadth-first-search
+
–
288
views
0
answers
0
votes
Memory Based GATE DA 2024 | Question: 54
Hashing question: Given alpha asking for the expected no of probes.Consider the average time complexity in an unsuccessful search for open-addressing hashing with linear probing. If \( \alpha ... )\( 1 + \alpha \)\(1 + \frac{ \alpha}{2} \)
GO Classes
288
views
GO Classes
asked
Feb 4
Algorithms
gate2024-da-memory-based
goclasses
algorithms
hashing
linear-probing
+
–
346
views
1
answers
4
votes
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 14
Given that $f(n)=O(g(n))$ (where $\mathrm{O}$ is Big-O) and $f(n)=\Omega(g(n))$, which of the following statement is always true?$f(n)=o(g(n))$ (here $o$ is small-$o).$f(n)=\theta(g(n))$.$f(n)=\omega(g(n))$.Both A and B are always true.
GO Classes
346
views
GO Classes
asked
Jan 28
Algorithms
goclasses2024-mockgate-13
goclasses
algorithms
asymptotic-notation
1-mark
+
–
881
views
1
answers
4
votes
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 15
Professor Fiorina uses the following algorithm to merge $k$ sorted lists, each containing $n / k$ elements.She takes the first list and merges it with the second list using a ... $\theta(k \log n)$
GO Classes
881
views
GO Classes
asked
Jan 28
Algorithms
goclasses2024-mockgate-13
goclasses
algorithms
merge-sort
1-mark
+
–
426
views
1
answers
5
votes
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 41
Consider the following weighted graph, where the weight of every edge is written on the edge itself.What is the number of possible minimum spanning trees for the above graph?
GO Classes
426
views
GO Classes
asked
Jan 28
Algorithms
goclasses2024-mockgate-13
goclasses
numerical-answers
algorithms
graph-algorithms
minimum-spanning-tree
2-marks
+
–
819
views
1
answers
11
votes
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 42
Consider the following statements related to Huffman's algorithm:$\text{S1:}$ If there is exactly one symbol with a frequency of $1 / 3$, and all other symbols have frequencies ... , but $\mathrm{S} 2$ is true.S1 is false, and S2 is false.
GO Classes
819
views
GO Classes
asked
Jan 28
Algorithms
goclasses2024-mockgate-13
goclasses
algorithms
greedy-algorithm
huffman-code
2-marks
+
–
136
views
0
answers
0
votes
how can it have back edges?
pcla
136
views
pcla
asked
Jan 27
Algorithms
algorithms
graph-algorithms
depth-first-search
+
–
1.1k
views
1
answers
11
votes
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 1
Consider the two statements regarding the Huffman's algorithm -$\text{S1:}$ The character with the highest probability (all probabilities are unique) is ... $\mathrm{S} 2$ is correctBoth are correct statementsBoth are incorrect statements
GO Classes
1.1k
views
GO Classes
asked
Jan 21
Algorithms
goclasses2024-mockgate-12
goclasses
algorithms
greedy-algorithm
huffman-code
1-mark
+
–
598
views
1
answers
3
votes
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 28
You are given a bit-array $A[1 \ldots n]$ (i.e., $A[i] \in\{0,1\}$ for each $i$ ) and told that this is a "$0$ -to-$1$ bit-array. This means that ... $\Theta(n \log n)$\Theta(n)$\Theta\left(n^{2}\right)$
GO Classes
598
views
GO Classes
asked
Jan 21
Algorithms
goclasses2024-mockgate-12
goclasses
algorithms
divide-and-conquer
2-marks
+
–
716
views
2
answers
5
votes
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 29
Consider an array that has $10$ distinct elements. Suppose we use randomized quicksort (with the pivot chosen uniformly at random). What is the probability that the ... of the chosen pivot. The pivot itself is not part of any subarray.
GO Classes
716
views
GO Classes
asked
Jan 21
Algorithms
goclasses2024-mockgate-12
goclasses
numerical-answers
algorithms
sorting
quick-sort
2-marks
+
–
596
views
1
answers
5
votes
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 30
Consider the following pseudocode for a function that operates on an $\textsf{N}$ element array $\textsf{A[1],A[2]},\dots,\textsf{A[N]}$ of integers.function ... $\textsf{A[j] < A[position]}$ checked?
GO Classes
596
views
GO Classes
asked
Jan 21
Algorithms
goclasses2024-mockgate-12
goclasses
numerical-answers
algorithms
identify-function
time-complexity
2-marks
+
–
1.1k
views
3
answers
3
votes
GO Classes Test Series 2024 | Mock GATE | Test 12 | Question: 54
Of the following, which gives the best upper bound for the value of $f(N)$ where $f$ is a solution to the recurrence$f(2 N+1)=f(2 N)=f(N)+\log N \text { for } N \geq 1,$with $f(1)=0?$O(\log N)$O(N \log N)$O\left((\log N)^2\right)$O(N)$
GO Classes
1.1k
views
GO Classes
asked
Jan 21
Algorithms
goclasses2024-mockgate-12
goclasses
algorithms
recurrence-relation
time-complexity
2-marks
+
–
Page:
« prev
1
2
3
4
5
6
7
...
118
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register