Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Recent questions and answers in Algorithms
261
views
1
answers
3
votes
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, ...
hari_unik99
261
views
hari_unik99
answered
16 hours
ago
Algorithms
goclasses2024-mockgate-14
algorithms
sorting
2-marks
+
–
99
views
1
answers
0
votes
Self Doubt
How to approach this type of questions?
Shaik Masthan
99
views
Shaik Masthan
answered
2 days
ago
Algorithms
algorithms
sorting
data-structures
+
–
9.4k
views
3
answers
33
votes
GATE CSE 2009 | Question: 53
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 ...
Nalinj
9.4k
views
Nalinj
answered
May 18
Algorithms
gatecse-2009
algorithms
normal
dynamic-programming
recursion
+
–
1.0k
views
1
answers
0
votes
GATE DS&AI 2024 | Question: 35
Consider the following sorting algorithms:Bubble sortInsertion sortSelection sortWhich ONE among the following choices of sorting algorithms sorts the numbers in the arra...
ikka
1.0k
views
ikka
answered
May 16
Algorithms
gate-ds-ai-2024
algorithms
sorting
+
–
13.5k
views
8
answers
35
votes
GATE CSE 2018 | Question: 45
Consider the following program written in pseudo-code. Assume that $x$ and $y$ are integers.Count (x, y) { if (y !=1 ) { if (x !=1) { print("*"); Count (x/2, y); } else {...
suraj_soni
13.5k
views
suraj_soni
answered
May 16
Algorithms
gatecse-2018
numerical-answers
algorithms
recursion
2-marks
+
–
904
views
2
answers
2
votes
NIELIT Scientific Assistant A 2020 November: 88
The given array is $\text{arr={1, 2, 4, 3}}$. Bubble sort is used to sort the array elements. How many passes will be done to sort the array?$4$$2$$1$$3$
sagarsanjaypawar15
904
views
sagarsanjaypawar15
answered
May 16
Algorithms
nielit-sta-2020
algorithms
sorting
bubble-sort
+
–
5.2k
views
5
answers
12
votes
GATE CSE 2021 Set 2 | Question: 23
Consider the following $\text{ANSI C}$ function:int SomeFunction (int x, int y) { if ((x==1) || (y==1)) return 1; if (x==y) return x; if (x y) return SomeFunction(x-y, y...
Shubhamishere
5.2k
views
Shubhamishere
answered
May 15
Algorithms
gatecse-2021-set2
numerical-answers
algorithms
identify-function
output
1-mark
+
–
6.5k
views
5
answers
8
votes
GATE CSE 2021 Set 1 | Question: 48
Consider the following $\text{ANSI C}$ function:int SimpleFunction(int Y[], int n, int x) { int total = Y[0], loopIndex; for (loopIndex=1; loopIndex<=n-1; loopIndex++) to...
suraj_soni
6.5k
views
suraj_soni
answered
May 14
Algorithms
gatecse-2021-set1
algorithms
numerical-answers
identify-function
2-marks
+
–
11.6k
views
5
answers
26
votes
GATE CSE 2009 | Question: 18
Consider the program below:#include <stdio.h int fun(int n, int *f_p) { int t, f; if (n <= 1) { *f_p = 1; return 1; } t = fun(n-1, f_p); f = t + *f_p; *f_p = t; return f;...
theradash
11.6k
views
theradash
answered
May 13
Algorithms
gatecse-2009
algorithms
recursion
identify-function
normal
+
–
13.4k
views
5
answers
27
votes
GATE CSE 2005 | Question: 31
Consider the following C-program:void foo (int n, int sum) { int k = 0, j = 0; if (n == 0) return; k = n % 10; j = n/10; sum = sum + k; foo (j, sum); printf ("%d,",k); } ...
theradash
13.4k
views
theradash
answered
May 13
Algorithms
gatecse-2005
algorithms
identify-function
recursion
normal
+
–
511
views
2
answers
1
votes
Output Of C Program
#include<stdio.h>int main(){ int x,sum; sum=0; for(x=0;x<=500;x+=10){ sum=sum+x; } printf("%d",sum); return 0;} What is output of above C-program...
lordvarys
511
views
lordvarys
answered
May 12
Algorithms
algorithms
programming-in-c
+
–
175
views
1
answers
0
votes
Divide and conquer
In quick sort, n numbers the (n/10)th element is selected as pivot using n^2 sortimng time complexity what will be the time complexity of quick sort is.....a)O(nlogn)b)O(...
Bhaskar_Saini
175
views
Bhaskar_Saini
answered
May 12
Algorithms
divide-and-conquer
algorithms
time-complexity
recurrence-relation
sorting
+
–
9.5k
views
5
answers
16
votes
GATE IT 2008 | Question: 82
Consider the code fragment written in C below :void f (int n) { if (n <=1) { printf ("%d", n); } else { f (n/2); printf ("%d", n%2); } }What does f(173) print?$010110101$...
ritiksri8
9.5k
views
ritiksri8
answered
May 11
Algorithms
gateit-2008
algorithms
recursion
identify-function
normal
+
–
11.9k
views
5
answers
27
votes
GATE CSE 2010 | Question: 35
What is the value printed by the following C program?#include<stdio.h int f(int *a, int n) { if (n <= 0) return 0; else if (*a % 2 == 0) return *a+f(a+1, n-1); else retur...
ritiksri8
11.9k
views
ritiksri8
answered
May 10
Algorithms
gatecse-2010
algorithms
recursion
identify-function
normal
+
–
9.3k
views
2
answers
27
votes
GATE CSE 2000 | Question: 2.15
Suppose you are given an array $s[1....n]$ and a procedure reverse $(s, i, j)$ which reverses the order of elements in $s$ between positions $i$ and $j$ (both inclusive)....
theradash
9.3k
views
theradash
answered
May 10
Algorithms
gatecse-2000
algorithms
normal
identify-function
+
–
5.0k
views
2
answers
21
votes
GATE CSE 1997 | Question: 4.6
Let $T(n)$ be the function defined by $T(1) =1, \: T(n) = 2T (\lfloor \frac{n}{2} \rfloor ) + \sqrt{n}$ for $n \geq 2$.Which of the following statements is true?$T(n) = O...
theradash
5.0k
views
theradash
answered
May 7
Algorithms
gate1997
algorithms
recurrence-relation
normal
+
–
18.4k
views
6
answers
46
votes
GATE CSE 2011 | Question: 37
Which of the given options provides the increasing order of asymptotic complexity of functions $f_1, f_2, f_3$ and $f_4$?$f_1(n) = 2^n$$f_2(n) = n^{3/2}$$f_3(n) = n \log_...
theradash
18.4k
views
theradash
answered
May 6
Algorithms
gatecse-2011
algorithms
asymptotic-notation
normal
+
–
134
views
1
answers
2
votes
algorithms
for (i = 1; i <= N; i++){ for (j= 1;j <= i^2;j=j+i){ //some code}} how is this O(n^2)? explain in detail and simple terms
Bhaskar_Saini
134
views
Bhaskar_Saini
answered
Apr 29
Algorithms
algorithms
time-complexity
+
–
18.9k
views
4
answers
57
votes
GATE IT 2008 | Question: 10
Arrange the following functions in increasing asymptotic order:$n^{1/3}$$e^n$$n^{7/4}$$n \log^9n$$1.0000001^n$a, d, c, e, bd, a, c, e, ba, c, d, e, ba, c, d, b, e
Puneet312
18.9k
views
Puneet312
answered
Apr 24
Algorithms
gateit-2008
algorithms
asymptotic-notation
normal
+
–
994
views
2
answers
2
votes
GO Classes 2023 | IIITH Mock Test 1 | Question: 10
$\text{G}$ is a directed graph with negative weight edges but NO negative weight cycles. Which of the following hold for Dijkstra’s algorithm on $\text{G}:$Dijkstra’s...
SarthakShastri
994
views
SarthakShastri
answered
Apr 24
Algorithms
goclasses2023-iiith-mock-1
goclasses
algorithms
dijkstras-algorithm
shortest-path
1-mark
+
–
725
views
1
answers
3
votes
Number of possible permutations that can be obtained using stack for input seq
Number of possible permutations that can be obtained using stack if the input sequence is 1, 2, 3, 4, 5 (in the order) is
soumya24
725
views
soumya24
answered
Apr 22
Algorithms
algorithms
stack
+
–
313
views
1
answers
0
votes
bfs dfs
Which of the following statements is/are correct?Consider 'n' as the number of nodes in graph.A.In an unweighted, undirected connected graph, Dijkstra’s algorithm can b...
jenilS7
313
views
jenilS7
answered
Apr 21
Algorithms
algorithms
bellman-ford
time-complexity
+
–
606
views
1
answers
0
votes
Made Easy Test Series 2024
Suppose we have a directed graph G = (V,E) with V= {1, 2, ..., n} and Eis presented as an adjacency list. For each vertex u in V, out(u) is a list such that (u, v) in {1,...
jenilS7
606
views
jenilS7
answered
Apr 21
Algorithms
made-easy-test-series
algorithms
made-easy-booklet
algorithm-design
time-complexity
linked-list
graph-theory
graph-algorithms
+
–
550
views
2
answers
1
votes
test series
int i,j,k,s=0; for(i=1; i<=n; i++) { for(j=1 ; j<=i; j=j*2) { for(k=n; k>1;k=k/2) { s++; } } }What will be the time complexity of the above code?
jenilS7
550
views
jenilS7
answered
Apr 21
Algorithms
zeal
algorithms
time-complexity
asymptotic-notation
+
–
2.2k
views
2
answers
1
votes
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 componen...
Sanjana Chamarthy
2.2k
views
Sanjana Chamarthy
answered
Apr 21
Algorithms
gatecse2024-set1
numerical-answers
graph-search
graph-algorithms
+
–
469
views
1
answers
2
votes
GO Classes Test Series 2024 | Mock GATE | Test 11 | Question: 25
A linear-probing hash table of length $10$ uses the hash function $h(x)=x \bmod 10$. After inserting six integer keys into an initially empty hash table, the array of key...
Prashantprashant
469
views
Prashantprashant
answered
Apr 16
Algorithms
goclasses2024-mockgate-11
goclasses
algorithms
hashing
linear-probing
multiple-selects
1-mark
+
–
28.6k
views
9
answers
113
votes
GATE CSE 2013 | Question: 30
The number of elements that can be sorted in $\Theta(\log n)$ time using heap sort is$\Theta(1)$$\Theta(\sqrt{\log} n)$$\Theta(\frac{\log n}{\log \log n})$$\Theta(\log n)...
cprdereddyy
28.6k
views
cprdereddyy
answered
Apr 16
Algorithms
gatecse-2013
algorithms
sorting
normal
heap-sort
+
–
18.2k
views
12
answers
65
votes
GATE IT 2005 | Question: 14
In a depth-first traversal of a graph $G$ with $n$ vertices, $k$ edges are marked as tree edges. The number of connected components in $G$ is$k$$k+1$$n-k-1$$n-k$
parag parab
18.2k
views
parag parab
answered
Apr 15
Algorithms
gateit-2005
algorithms
graph-algorithms
normal
graph-search
+
–
2.0k
views
1
answers
6
votes
PGEE Sample Question
Consider the following four data structures: array, binary search tree, hash table, and a linked list. Which of the following options arranges them in non-decreasing orde...
SurbhiS
2.0k
views
SurbhiS
answered
Apr 11
Algorithms
iiith-pgee
algorithms
+
–
791
views
2
answers
1
votes
UGC NET CSE | December 2004 | Part 2 | Question: 25
How much extra space is used by heapsort ?$O (1)$$O (\log n)$$O (n)$$O (n^2)$
kumaruk
791
views
kumaruk
answered
Apr 10
Algorithms
algorithms
heap-sort
ugcnetcse-dec2004-paper2
+
–
101
views
0
answers
0
votes
Algorithms notes from Go classes
can anyone have the algorithm notes from go classes (PDF or material)
aravindhz
101
views
aravindhz
asked
Apr 4
43.9k
views
8
answers
19
votes
Minimum number of comparisons required to sort 5 elements is
The minimum number of comparisons required to sort 5 elements is -4567
abhishek_tyagi
43.9k
views
abhishek_tyagi
answered
Mar 28
Algorithms
algorithms
sorting
+
–
197
views
1
answers
1
votes
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...
Teet Makor
197
views
Teet Makor
answered
Mar 26
Algorithms
recurrence-relation
algorithms
sequence-series
+
–
503
views
2
answers
0
votes
Prove that for any constant c > 0, (log n)^c = o(n).
Teet Makor
503
views
Teet Makor
answered
Mar 23
Algorithms
algorithms
time-complexity
+
–
134
views
1
answers
0
votes
Prove that n! = Ω(n^100)
Teet Makor
134
views
Teet Makor
answered
Mar 23
Algorithms
theory-of-computation
algorithms
time-complexity
+
–
11.7k
views
4
answers
34
votes
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...
ritiksri8
11.7k
views
ritiksri8
answered
Mar 21
Algorithms
gateit-2007
algorithms
graph-algorithms
normal
ugcnetcse-june2012-paper3
shortest-path
+
–
206
views
0
answers
0
votes
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
206
views
Ujjal Das
asked
Mar 17
Algorithms
algorithms
merge-sort
+
–
287
views
1
answers
0
votes
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...
DEBANJAN DAS2k
287
views
DEBANJAN DAS2k
answered
Mar 15
Algorithms
algorithms
sorting
time-complexity
asymptotic-notation
+
–
724
views
2
answers
1
votes
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 ...
Priyam Garg
724
views
Priyam Garg
answered
Mar 15
Algorithms
cmi2010
descriptive
algorithms
algorithm-design
+
–
8.1k
views
7
answers
21
votes
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$...
ritiksri8
8.1k
views
ritiksri8
answered
Mar 14
Algorithms
gatecse-2007
algorithms
graph-algorithms
topological-sort
easy
+
–
To see more, click for all the
questions in this category
.
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register