GATE CSE
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
All Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions.
Recent activity by Debashish Deka
User Debashish Deka
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
User Debashish Deka
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
1
answer
1
Ravi asked his neighbor to water a delicate plant while he is away.
answered
1 day
ago
in
Probability

27
views
probability
1
answer
2
A bit string is called legitimate if it contains no consecutive zeros, e.g., 0101110 is legitimate,
answered
1 day
ago
in
Combinatory

20
views
combinatorics
1
answer
3
complexity
Let there are n elements in array and number of sorted subarray is log n of size n/ log n each then what is the time complexity to sort given array
answered
2 days
ago
in
Algorithms

37
views
6
answers
4
GATE2017148
Let $A$ be an array of 31 numbers consisting of a sequence of 0's followed by a sequence of 1's. The problem is to find the smallest index $i$ such that $A\left [i \right ]$ is 1 by probing the minimum number of locations in $A$. The worst case number of probes performed by an optimal algorithm is ____________.
commented
2 days
ago
in
Algorithms

1.1k
views
gate20171
algorithms
normal
numericalanswers
1
answer
5
#Confusion Is it necessary to arrange the weights in Ascending order while solving 0/1 Knapsack problem using Dynamic
commented
2 days
ago
in
Algorithms

35
views
knapsack
algorithms
0
answers
6
What is the highest power of 18 contained
commented
2 days
ago
in
Combinatory

69
views
combinatory
1
answer
7
context free grammar
Construct contextfree grammars to accept the following languages. $$\begin{align*} \large L = \left \{ 0^i1^j2^k \;\;  \;\; i \neq j \;\; or \;\; j \neq k \right \} \end{align*}$$
answered
2 days
ago
in
Theory of Computation

25
views
cfg
contextfree
theoryofcomputation
1
answer
8
Rosen (proposition logic)
The nth statement in a list of 100 statements is “Exactly n of the statements in this list are false.” a) What conclusions can you draw from these statements? b) Answer part (a) if the nth statement is “At least n of the statements in this list are false.” c) Answer part (b) assuming that the list contains 99 statements.
commented
3 days
ago
in
Mathematical Logic

37
views
1
answer
9
group theory
Is ( {0},* ) a group ? ( where * stands for multiplication operation ). Please provide explanations with your answer
answer selected
3 days
ago
in
Set Theory & Algebra

69
views
discretemathematics
groups
settheory&algebra
engineeringmathematics
sets
1
answer
10
group theory
which among the following statements is TRUE ? S1 : ( { 0,1,2....(m1) } , +m ) where +m stands for "additionmodulom" S2 : ( {0,1,2....m} , +m ) where +m stands for "additionmodulom". A) ONLY S1 is a group. B) ONLY S2 is a group. C) BOTH S1 AND S2 are groups. D) NEITHER S1 NOT S2 is a group.
answer edited
3 days
ago
in
Set Theory & Algebra

26
views
discretemathematics
groups
settheory&algebra
engineeringmathematics
sets
1
answer
11
BARC2017
Time complexity of dijkstra's algorithm when array used in place of priority queue Options O(V^2) , O(VlogV+E) , O(VlogV+ElogV) , O(V^3)
commented
3 days
ago
in
Algorithms

52
views
1
answer
12
list type
// Graph class represents a undirected graph // using adjacency list representation class Graph { int V; // No. of vertices // Pointer to an array containing adjacency lists list<int> *adj; } is 'list' a datatype?? where can i study about it??
commented
3 days
ago
in
Programming

40
views
programminginc
2
answers
13
error in the code
why is it showing error?? #include <stdio.h> int main() { extern int i; i=20; printf("%d",i); }
answered
3 days
ago
in
Programming

56
views
programminginc
2
answers
14
C programming doubt
I am getting segmentation fault for the following code.Please help to rectify. #include <stdio.h> #include <stdlib.h> struct person { int age; float weight; char *name; }; int main() { struct person *ptr; int i, num; printf("Enter number of ... ;%s\t%d\t%.2f\n", ptr>name[i], (ptr+i)>age, (ptr+i)>weight); return 0; }
commented
4 days
ago
in
Programming

90
views
0
answers
15
C Programming (interview)
WAP where smallest subarrays with sum greater than x? Say an array={1,5,6,2,45,17}; Now, x=60 Now we have to find smallest subarray which is greater than x
commented
4 days
ago
in
Programming

90
views
programminginc
output
cprogramming
0
answers
16
C Programming(interview)
Write an algorithm of the given problem Given a chess board of order NxM and source points (s1,s2) and destination points (d1,d2), Your task to find min number of moves required by the Knight to go to the destination cell.
commented
5 days
ago
in
Programming

106
views
programminginc
cprogramming
2
answers
17
MIT Course
For each group of functions, sort the functions in increasing order of asymptotic (bigO) complexity: $\begin{align*} &(a) \;\;f1(n) = n^{0.999999} * \log n \\ &(b) \;\;f2(n) = 10000000n \\ &(c) \;\; ... exponential function, but since the power is to 1.000001, it is growing very slowly, since base is tending to 1 only. Someone please check this.
answered
5 days
ago
in
Algorithms

69
views
timecomplexity
algorithms
2
answers
18
ISI PCB 2014 C3 (A)
Prove that the language {aN : N is a composite number} is not regular.
answered
5 days
ago
in
Theory of Computation

41
views
1
answer
19
Peter Linz Exercise 5.1 #11
Find a context free grammar for ∑ = {a,b} for the language L = { an wwR bn : w ∈ ∑*, n>=1 } I have worked out the following set of productions S> aSb  aAb //generates anbn A> aXa  bXb  ∈ (Generates wwR which can be considered as string starting and ending with same symbol). X> aX  bX  ∈ are my productions correct?
answered
Mar 21
in
Theory of Computation

31
views
theoryofcomputation
grammar
1
answer
20
GATE200581a
double foo(int n) { int i; double sum; if(n == 0) { return 1.0; } else { sum = 0.0; for(i = 0; i < n; i++) { sum += foo(i); } return sum; } } The space complexity of the above code is? $O(1)$ $O(n)$ $O(n!)$ $n^n$
answer edited
Mar 21
in
Algorithms

1.1k
views
gate2005
algorithms
spacecomplexity
normal
2
answers
21
GATE200581b
double foo(int n) { int i; double sum; if(n == 0) { return 1.0; } else { sum = 0.0; for(i = 0; i < n; i++) { sum += foo(i); } return sum; } } Suppose we modify the above function foo() and stores the value ... time complexity for function foo() is significantly reduced. The space complexity of the modified function would be: $O(1)$ $O(n)$ $O(n^2)$ $n!$
answer edited
Mar 21
in
Algorithms

349
views
gate2005
algorithms
spacecomplexity
normal
1
answer
22
Peter Linz Exercise 5.3
Find the contextfree grammar for the following language(n>=0 and m>=0) ? L={an bm : n<=m+3}
answered
Mar 19
in
Theory of Computation

35
views
theoryofcomputation
grammar
1
answer
23
Peter Linz Exercise 5.1
Give a contextfree grammar for the language below : (n>=0, m>=0) L= { w ∊ {a,b}* : na(w)=2nb(w)+1}
answered
Mar 19
in
Theory of Computation

30
views
theoryofcomputation
grammar
2
answers
24
techtud c programming
Ans is C can anybody justify why compilation error
commented
Mar 19
in
Programming

67
views
programminginc
output
1
answer
25
No of spanning Trees
Let $K_n$ denote the complete undirected graph with $n$ vertices where n is an even number. Find the maximum number of spanning trees of $K_n$ that can be formed in such a way that no two of these spanning trees have a common edge.
asked
Mar 19
in
Graph Theory

32
views
spanningtree
graphtheory
0
answers
26
Recurrence relation and generating function
asked
Mar 19
in
Combinatory

29
views
generatingfunctions
combinatorics
recurrenceeqation
2
answers
27
c programming
#include <stdio.h> int K = 4; int a[2]; unsigned int m; int* check(unsigned int n) { int res = 1; int count = 0; for(int i=0;i<K;i++) if(!(n&(1<<i))) { count++; res = 0; } a[0] = res; a[1] = count; return a; } int foo( ... = x[1]; foo(mi,i+1); return count; } int main() { int x = foo(0,0); printf("%d\n",x); } value of x ___ ?
asked
Mar 19
in
Programming

71
views
programminginc
1
answer
28
pointer
int main(){ int a[5]={1,2,3,4,5}; char *str="hello"; printf("%p %p",a,&a); printf("%p %p",str,&str); } Why in $1$st printf , both the outputs are same($a$,&$a$) And in $2$nd printf ,both the outputs are different(str,&str) please help!
edited
Mar 18
in
Programming

81
views
programminginc
2
answers
29
recursion in c
output of program: void function(int); void main() { function(3); } void function(int num){ if(num>0) { function(num); printf("%d",num); function(num); } } will the argument num value be retained at all recursion levels?
answered
Mar 17
in
Programming

63
views
programminginc
recursion
0
answers
30
set theory
commented
Mar 17
in
Set Theory & Algebra

27
views
settheory&algebra
discretemathematics
engineeringmathematics
sets
1
answer
31
set theory
answered
Mar 17
in
Set Theory & Algebra

28
views
settheory&algebra
discretemathematics
engineeringmathematics
sets
2
answers
32
write locks are released after last operation of transaction but before its commit ! explain
answered
Mar 17
in
Databases

55
views
databases
transactions
2
answers
33
Peter Linz Exercise 4.3
Show that the language $$\begin{align*} L = \left \{ a^nb^{n+k} \;\; : n\geq 0,k\geq 1 \right \} \cup \left \{ a^{n+k}b^{n} \;\; : n\geq 0,k\geq 3 \right \} \end{align*}$$ is not Regular.
edited
Mar 16
in
Theory of Computation

56
views
theoryofcomputation
regularlanguage
0
answers
34
Kenneth Rosen 6.444 advanced counting
asked
Mar 15
in
Combinatory

32
views
discretemathematics
generatingfunctions
recurrenceequation
0
answers
35
Generating function
Let $h_n$ denote the number of nonnegative integral solutions of the equation $3x_1 + 4x_2 + 2x_3 + 5x_4 = n$ Find the generating function $g(x)$ for $h_0,h_1,h_2,h_3 ... h_n$
asked
Mar 15
in
Combinatory

19
views
generatingfunctions
combinatorics
1
answer
36
source
void fun(int **pptr) { int q = 10; *pptr = &q; } int main() { int r = 20; int *p = &r; fun(&p); printf("%d", *p); return 0; } The output of the program is 10 . But as q here is an automatic variable, the result shouldn't be 10.
commented
Mar 14
in
Programming

153
views
1
answer
37
Peter Linz Exercise 3.2
Construct regular expression for the automata given below :
commented
Mar 12
in
Theory of Computation

70
views
theoryofcomputation
regularexpressions
4
answers
38
GATE20172GA10
An air pressure contour line joins locations in a region having the same atmospheric pressure. The following is an air pressure contour plot of a geographical religion. Contour lines are shown at 0.05 bar intervals in this plot. If the possibility ... or drops over a region, which of the following regions is most likely to have a thunderstorm? P Q R S
answered
Mar 12
in
Numerical Ability

932
views
gate20172
1
answer
39
float vs double
Program 1: #include<stdio.h> int main() { float x = 0.1; if (x == 0.1) printf("IF"); else if (x == 0.1f) printf("ELSE IF"); else printf("ELSE"); } The output of above program is ... weird output and is there any way to predict these outputs on the same processor. Also how comparison is done of two variables in C ?
commented
Mar 12
in
Programming

134
views
programminginc
ieeerepresentation
undefinedbehaviour
1
answer
40
C language
Consider the following C program. What's the Output and does it depends on the compiler used to run this code? #include<stdio.h> int main() { int i = 1; printf("%d %d %d\n", i++, i++, i); return 0; }
commented
Mar 10
in
Programming

41
views
21,516
questions
26,842
answers
61,138
comments
23,176
users