Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Recent questions and answers in Algorithms
0
votes
2
answers
1
Prove that for any constant c > 0, (log n)^c = o(n).
Teet Makor
answered
in
Algorithms
6 days
ago
by
Teet Makor
445
views
algorithms
time-complexity
0
votes
1
answer
2
Prove that n! = Ω(n^100)
Teet Makor
answered
in
Algorithms
6 days
ago
by
Teet Makor
53
views
theory-of-computation
algorithms
time-complexity
34
votes
4
answers
3
GATE IT 2007 | Question: 3, UGCNET-June2012-III: 34
Consider a weighted, undirected graph with positive edge weights and let $uv$ be an edge in the graph. It is known that the shortest path from the source vertex $s$ to $u$ has weight 53 and the shortest path from $s$ to $v$ has weight 65. Which one of the ... $(u,v) \leq 12$ Weight $(u,v) = 12$ Weight $(u,v) \geq 12$ Weight $(u,v) > 12$
ritiksri8
answered
in
Algorithms
Mar 21
by
ritiksri8
11.2k
views
gateit-2007
algorithms
graph-algorithms
normal
ugcnetcse-june2012-paper3
2
votes
2
answers
4
GATE CSE 2024 | Set 1 | Question: 24
The number of spanning trees in a complete graph of $4$ vertices labelled $\text{A, B, C,}$ and $\text{D}$ is _________.
ritiksri8
answered
in
Algorithms
Mar 20
by
ritiksri8
1.6k
views
gatecse2024-set1
numerical-answers
algorithms
0
votes
0
answers
5
Recurrence relation
What is the returned value by the given function below. Algo fun(n) { If(x<=2) return 1; Else { Return fun(n1/2) + n; } } Note : Assume that all the syntax and data type constraints are valid and just check algorithm.
jenilS7
asked
in
Algorithms
Mar 18
by
jenilS7
46
views
recurrence-relation
algorithms
sequence-series
0
votes
0
answers
6
Merge Sort
Calculate the minimum and maximum number of element comparisons involved in 2 way merge sort assuming n is power of 2.
Ujjal Das
asked
in
Algorithms
Mar 17
by
Ujjal Das
75
views
algorithms
merge-sort
0
votes
1
answer
7
Sorting Algorithm
For flag based approach in Bubble sort we can check first by a flag if the list is sorted or not in O(n), and if it is sorted, then no need to sort and the operation ends in Best case = O(n). Why isn't the same concept applicable to selection sort? Why it never comes down from O(n$^2$)?
DEBANJAN DAS2k
answered
in
Algorithms
Mar 15
by
DEBANJAN DAS2k
121
views
algorithms
sorting
time-complexity
asymptotic-notation
1
vote
2
answers
8
CMI2010-B-01b
An international cellphone company provides service on 7 different frequencies. They wish to set up business in Tamil Nadu and have fixed the locations of 100 towers for their new service. The company has to ensure that two towers broadcasting on the same ... should say feasible if it is feasible, otherwise output the minimum number of frequencies needed to utilise all 100 towers.
Priyam Garg
answered
in
Algorithms
Mar 15
by
Priyam Garg
631
views
cmi2010
descriptive
algorithms
algorithm-design
21
votes
7
answers
9
GATE CSE 2007 | Question: 5
Consider the DAG with $V = \{1,2,3,4,5,6\}$ shown below. Which of the following is not a topological ordering? $1$ $2$ $3$ $4$ $5$ $6$ $1$ $3$ $2$ $4$ $5$ $6$ $1$ $3$ $2$ $4$ $6$ $5$ $3$ $2$ $4$ $1$ $6$ $5$
ritiksri8
answered
in
Algorithms
Mar 14
by
ritiksri8
7.7k
views
gatecse-2007
algorithms
graph-algorithm
topological-sort
easy
1
vote
1
answer
10
DRDO CSE 2022 Paper 1 | Question: 33 (b)
Consider the following graph. How many nodes (apart from $s$) does the Depth First Search algorithm discover before discovering $t$ when starting from $s.$
mishraamulya
answered
in
Algorithms
Mar 10
by
mishraamulya
244
views
drdocse-2022-paper1
2-marks
descriptive
1
vote
2
answers
11
GATE CSE 2024 | Set 2 | Question: 41
Let $\text{G}$ be an undirected connected graph in which every edge has a positive integer weight. Suppose that every spanning tree in $\text{G}$ has even weight. Which of the following statements is/are TRUE for every such graph $\text{G}$ ... $\text{C}$ have even weight $\text{OR}$ all edges in $\text{C}$ have odd weight
SkillIssue
answered
in
Algorithms
Mar 8
by
SkillIssue
1.8k
views
gatecse2024-set2
algorithms
multiple-selects
5
votes
3
answers
12
ISRO2007-23
Study the following program //precondition: x>=0 public void demo(int x) { System.out.print(x % 10); if (x % 10 != 0) { demo(x/10); } System.out.print(x%10); } Which of the following is printed as a result of the call demo $(1234)$? $1441$ $3443$ $12344321$ $43211234$
teja1521
answered
in
Algorithms
Mar 4
by
teja1521
3.6k
views
isro2007
algorithms
identify-function
0
votes
1
answer
13
#algorithm
how many spanning trees are possible for complete graph of 4 vertices
closed
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
answered
in
Algorithms
Mar 3
by
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
91
views
algorithms
data-structures
graph-theory
1
vote
3
answers
14
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.$ Which one of the following options is CORRECT? $T(n)=\Theta(n \log \log n)$ $T(n)=\Theta(n \log n)$ $T(n)=\Theta\left(n^2 \log n\right)$ $T(n)=\Theta\left(n^2 \log \log n\right)$
skypaul101
answered
in
Algorithms
Feb 29
by
skypaul101
1.8k
views
gatecse2024-set1
algorithms
2
votes
4
answers
15
GATE CSE 2024 | Set 2 | Question: 5
Let $\text{T(n)}$ be the recurrence relation defined as follows: \[ \begin{array}{l} T(0)=1, \\ T(1)=2, \text { and } \\ T(n)=5 T(n-1)-6 T(n-2) \text { for } n \geq 2 \end{array} \] Which one of the following statements is TRUE? $T(n)=\Theta\left(2^{n}\right)$ $T(n)=\Theta\left(n 2^{n}\right)$ $T(n)=\Theta\left(3^{n}\right)$ $T(n)=\Theta\left(n 3^{n}\right)$
Priyam Garg
answered
in
Algorithms
Feb 27
by
Priyam Garg
2.0k
views
gatecse2024-set2
algorithms
recurrence-relation
asymptotic-notation
21
votes
4
answers
16
GATE CSE 2023 | Question: 44
Consider functions $\textsf{Function_1}$ and $\textsf{Function_2}$ ... $f_{1}(n) \in \omega\left(f_{2}(n)\right)$ $f_{1}(n) \in O(n)$
KG
answered
in
Algorithms
Feb 24
by
KG
11.2k
views
gatecse-2023
algorithms
asymptotic-notation
multiple-selects
2-marks
0
votes
0
answers
17
In rural Ireland, a century ago, the students had to form a line. The student at the front of the line would be asked to spell a word. If he spelled it correctly, he was allowed to sit down. If not, he received a whack on the hand with a switch and was sent to the end of the line. Suppose that a student could spell correctly 70% of the words in the lesson. What is the probability that the student would be able to sit down before receiving four whacks on the hand? Assume that the master chose the words to be spelled randomly and independently.
tim20
asked
in
Algorithms
Feb 22
by
tim20
70
views
algorithms
probability
0
votes
1
answer
18
TS
$\text{Please explain True or False and Why ?}$ $\text{1. f(n) = O(f(n/2))}$ $\text{2. f(n) = O($f(n)^{2}$) }$
ashmit.26
answered
in
Algorithms
Feb 21
by
ashmit.26
232
views
algorithms
time-complexity
asymptotic-notation
functions
1
vote
1
answer
19
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?
gate.datascience_ai
answered
in
Algorithms
Feb 19
by
gate.datascience_ai
228
views
gate2024-da-memory-based
goclasses
algorithms
quick-sort
numerical-answers
1
vote
1
answer
20
GATE CSE 2024 | Set 2 | Question: 49
The number of distinct minimum-weight spanning trees of the following graph is
shwetanshu12
answered
in
Algorithms
Feb 18
by
shwetanshu12
1.6k
views
gatecse2024-set2
numerical-answers
algorithms
minimum-spanning-tree
4
votes
2
answers
21
GATE CSE 2024 | Set 1 | Question: 35
Let $G$ be a directed graph and $T$ a depth first search $\text{(DFS)}$ spanning tree in $G$ that is rooted at a vertex $v$. Suppose $T$ is also a breadth first search $\text{(BFS)}$ tree in $G$, rooted at $v$. Which of the following ... the tree $T$ There are no forward-edge in $G$ with respect to the tree $T$ The only edges in $G$ are the edges in $T$
minip
answered
in
Algorithms
Feb 17
by
minip
3.1k
views
gatecse2024-set1
algorithms
multiple-selects
0
votes
1
answer
22
GATE DS&AI 2024 | Question: 41
Consider the directed acyclic graph (DAG) below: Which of the following is/are valid vertex orderings that can be obtained from a topological sort of the DAG? $\text{P Q R S T U V}$ $\text{P R Q V SUT}$ $\text{P Q R S V U T}$ $\text{P R Q S V T U}$
liontig37
answered
in
Algorithms
Feb 17
by
liontig37
662
views
gate-ds-ai-2024
algorithms
topological-sort
directed-acyclic-graph
0
votes
2
answers
23
GATE DS&AI 2024 | Question: 6
Match the items in Column $1$ with the items in Column $2$ in the following table: \begin{array}{|ll|ll|} \hline & \text{Column 1} & & \text{Column 2} \\ \hline & & & \\ \text{(p)} & \text{First In First Out} & \text{ ... $(\mathrm{p})-(\mathrm{i}),(\mathrm{q})-(\mathrm{iii}),(\mathrm{r})-(\mathrm{ii})$
Hira Thakur
answered
in
Algorithms
Feb 17
by
Hira Thakur
748
views
gate-ds-ai-2024
algorithms
match-the-following
0
votes
1
answer
24
GATE CSE 2024 | Set 1 | Question: 50
The number of edges present in the forest generated by the $\text{DFS}$ traversal of an undirected graph $G$ with $100$ vertices is $40$. The number of connected components in $G$ is __________.
shishir__roy
answered
in
Algorithms
Feb 17
by
shishir__roy
1.6k
views
gatecse2024-set1
numerical-answers
0
votes
3
answers
25
GATE DS&AI 2024 | Question: 20
Consider sorting the following array of integers in ascending order using an inplace Quicksort algorithm that uses the last element as the pivot. \begin{array}{|l|l|l|l|l|} \hline 60 & 70 & 80 & 90 & 100 \\ \hline \end{array} The minimum number of swaps performed during this Quicksort is $\_\_\_\_\_\_\_\_$.
gaurav0to1
answered
in
Algorithms
Feb 17
by
gaurav0to1
1.1k
views
gate-ds-ai-2024
numerical-answers
algorithms
quick-sort
0
votes
1
answer
26
GATE DS&AI 2024 | Question: 35
Consider the following sorting algorithms: Bubble sort Insertion sort Selection sort Which ONE among the following choices of sorting algorithms sorts the numbers in the array $[4,3,2,1,5]$ in increasing order after exactly two passes over the array? $\text{(i)}$ only $\text{(iii)}$ only $\text{(i)}$ and $\text{(iii)}$ only $\text{(ii)}$ and $\text{(iii)}$ only
Rahiman159
answered
in
Algorithms
Feb 17
by
Rahiman159
787
views
gate-ds-ai-2024
algorithms
sorting
0
votes
1
answer
27
GATE DS&AI 2024 | Question: 30
Let $F(n)$ denote the maximum number of comparisons made while searching for an entry in a sorted array of size $n$ using binary search. Which ONE of the following options is TRUE? $F(n)=F(\lfloor n / 2\rfloor)+1$ $F(n)=F(\lfloor n / 2\rfloor)+F(\lceil n / 2\rceil)$ $F(n)=F(\lfloor n / 2\rfloor)$ $F(n)=F(n-1)+1$
NarutoUzumaki
answered
in
Algorithms
Feb 16
by
NarutoUzumaki
780
views
gate-ds-ai-2024
algorithms
binary-search
0
votes
1
answer
28
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$ $82,11,93$ $131,11,93$ $131,111,90$
shishir__roy
answered
in
Algorithms
Feb 16
by
shishir__roy
2.1k
views
gatecse2024-set1
algorithms
1
vote
1
answer
29
GATE CSE 2024 | Set 2 | Question: 29
You are given a set $V$ of distinct integers. A binary search tree $T$ is created by inserting all elements of $V$ one by one, starting with an empty tree. The tree $T$ follows the convention that, at each node, all values ... determined from $V$ Preorder traversal of $T$ can be determined from $V$ Postorder traversal of $T$ can be determined from $V$
supreetshukla
answered
in
Algorithms
Feb 16
by
supreetshukla
1.8k
views
gatecse2024-set2
algorithms
1
vote
2
answers
30
GATE CSE 2024 | Set 2 | Question: 25
Let $\text{A}$ be an array containing integer values. The distance of $\text{A}$ is defined as the minimum number of elements in $\text{A}$ that must be replaced with another integer so that the resulting array is sorted in non-decreasing order. The distance of the array $[2,5,3,1,4,2,6]$ is ___________.
supreetshukla
answered
in
Algorithms
Feb 16
by
supreetshukla
1.9k
views
gatecse2024-set2
numerical-answers
algorithms
sorting
1
vote
1
answer
31
GATE CSE 2024 | Set 1 | Question: 7
Given an integer array of size $N$, we want to check if the array is sorted (in either ascending or descending order). An algorithm solves this problem by making a single pass through the array and comparing each element of the array only with its adjacent elements. The ... $\Omega(N)$ but not $\mathrm{O}(N)$ neither $\mathrm{O}(N)$ nor $\Omega(N)$
shishir__roy
answered
in
Algorithms
Feb 16
by
shishir__roy
2.9k
views
gatecse2024-set1
algorithms
time-complexity
4
votes
1
answer
32
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)$, and it had to be replaced by $R(m)$, which runs in exponential ... $P(n)$ runs in polynomial time in $n$ if, for each call $Q(m),m \underline<\log \;n.$
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
answered
in
Algorithms
Feb 11
by
꧁༒☬ĿọŗԀ 🆂🅷🅸🆅🅰☬༒꧂
387
views
goclasses2024-mockgate-14
algorithms
asymptotic-notation
time-complexity
2-marks
0
votes
0
answers
33
GATE 2024
Consider an n element array which is to be sorted either in ascending or descending order. The given restriction is only one pass will be used for completely sorting the array and an element can compare with only it's adjacent pair. What will be the worst time complexity? Is this related to bubble sort algorithm or not?
TusharRana
asked
in
Algorithms
Feb 11
by
TusharRana
340
views
algorithms
sorting
2
votes
2
answers
34
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].$ ... sorting algorithms could we possibly have applied? Merge sort (top-down approach) Bubble sort Quicksort (Using First element as pivot) Insertion sort
Philosophical_Virus
answered
in
Algorithms
Feb 7
by
Philosophical_Virus
491
views
goclasses2024-mockgate-14
algorithms
sorting
merge-sort
multiple-selects
1-mark
4
votes
2
answers
35
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 truth. If Mary uses an optimal strategy then she will determine that answer at the end of exactly how many questions on the worst case? 999 500 32 10
Kamlesh Maurya
answered
in
Algorithms
Feb 6
by
Kamlesh Maurya
406
views
goclasses2024-mockgate-14
algorithms
binary-search
1-mark
4
votes
1
answer
36
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, p_C=0.2, p_D=0.2$ $p_A=0.25, p_B=0.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$
thecoderyabham
answered
in
Algorithms
Feb 6
by
thecoderyabham
405
views
goclasses2024-mockgate-14
algorithms
huffman-code
multiple-selects
1-mark
5
votes
1
answer
37
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 17
Consider the following function. If $n$ and $\mathrm{k}$ are positive integers, then the least value of $\mathrm{k}$ such that $\mathrm{f}(\mathrm{k})>n$ is approximately $\log _2\left(\log _2 n\right)$ $\log _2 n$ $n \log _2 n$ $2^n$
krishnajsw
answered
in
Algorithms
Feb 6
by
krishnajsw
441
views
goclasses2024-mockgate-14
algorithms
identify-function
time-complexity
1-mark
3
votes
0
answers
38
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 47
A $\text{stable sort}$ preserves the order of values that are equal with respect to the comparison function. We have a list of three-dimensional points $[(7, 1, 8),(3, 5, 7),(6, 1, 4),(6, 5, 9),(0, 2, 5),(9, 0, 9)].$ We sort these in ascending order by the ... $[(9, 0, 9),(6, 1, 4),(7, 1, 8),(0, 2, 5),(3, 5, 7),(6, 5, 9)]$
GO Classes
asked
in
Algorithms
Feb 5
by
GO Classes
185
views
goclasses2024-mockgate-14
algorithms
sorting
2-marks
0
votes
0
answers
39
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? PRQVSUT PQRSVUT PQRSTUV PRQSVUT
GO Classes
asked
in
Algorithms
Feb 4
by
GO Classes
119
views
gate2024-da-memory-based
goclasses
algorithms
graph-algorithm
topological-sort
47
votes
8
answers
40
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 between any two arrays. The worst-case time complexity of computing the median of the medians of $A_1, A_2, \dots , A_n$ is $O(n)$ $O(n \: \log \: n)$ $O(n^2)$ $\Omega (n^2 \log n)$
sohamm20
answered
in
Algorithms
Feb 4
by
sohamm20
32.6k
views
gatecse-2019
algorithms
time-complexity
2-marks
To see more, click for all the
questions in this category
.
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Recent questions and answers in Algorithms
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...