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.
Answers 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
vote
1
#PROG
Predict the output of following program. Assume that the numbers are stored in 2's complement form. #include<stdio.h> int main() { unsigned int x = 1; int y = ~0; if (x == y) printf("same"); else printf("not same"); return 0; } 1.SAME 2.NOT SAME
answered
5 days
ago
in
Programming

20
views
#progm
+1
vote
2
GATE20006
Let $S$ be a set of $n$ elements $\left\{1, 2,....., n\right\}$ and $G$ a graph with 2$^{n}$ vertices, each vertex corresponding to a distinct subset of $S$. Two vertices are adjacent iff the symmetric difference of the ... Every vertex in $G$ has the same degree. What is the degree of a vertex in $G$? How many connected components does $G$ have?
answered
May 12
in
Set Theory & Algebra

433
views
gate2000
settheory&algebra
normal
descriptive
+1
vote
3
ISI 2016 PCB C5
What will be the output of the following C program? If you think it will give a runtime error, you need to mention it. In either case, your answer must include proper justifications without which no credit will be given. #include<stdio.h> main() { unsigned char i, j, a[] = ... j != 0) a[0] += n; printf("j = %d, a[0] = %d\n", j, a[0]); }
answered
May 9
in
Others

57
views
programminginc
output
0
votes
4
MIT assignment Doubt
How the worst case of merge sort is O(n^2) according to the given MIT assignment pdf: explain ?
answered
May 9
in
Algorithms

67
views
algorithms
timecomplexity
+4
votes
5
ISRO201763
What does the following program do when the input is unsigned 16 bit integer? #include<stdio.h> main(){ unsigned int num; int i; scanf("%u", &num); for(i=0;i<16;i++){ printf("%d", (num<<i&1< ... } } It prints all even bits from num It prints all odd bits from num It prints binary equivalent of num None of above
answered
May 7
in
Programming

933
views
isro2017
programminginc
+8
votes
6
ISRO201780
The time complexity of computing the transitive closure of a binary relation on a set of $n$ elements is known to be a. $O(n\log n)$ b. $O\left( n^{3/2}\right)$ c. $O( n^3 )$ d. $O(n)$
answered
May 7
in
Algorithms

1.1k
views
isro2017
relations
algorithms
timecomplexity
0
votes
7
Placing rooks in nXn chess board
answered
May 6
in
Algorithms

58
views
nongate
recursion
game
combinatory
0
votes
8
linked list
I think option should be a) but given is c.here head pointer point the first node whereas tail pointer point the last node And if want to delete the first element then element will be deleted but head pointer will be free.then how to head pointer point the first node/element.Pls tell what is correct??
answered
May 1
in
DS

55
views
+1
vote
9
PGEE 2017
$\int_{3}^{3} \left  X+1 \right dx$
answered
Apr 30
in
Calculus

50
views
iiithpgee
calculus
+1
vote
10
ISI 2014
Read the C code given below. What would be the output of the following program? Justify your answer. #include <stdio.h> int myrecurse(int a, int b){ return (b == 1 ? a: myrecurse(a, b1) + a); } main() { int ... log n)$ algorithm to determine whether the given sequence $S$ has a subsequence whose sum is zero, and justify the correctness of the algorithm.
answered
Apr 26
in
Written Exam

78
views
isi2014
programminginc
algorithms
+3
votes
11
what is difference between "int * const ptr=&i" and const int *ptr;;
answered
Apr 21
in
Programming

69
views
programminginc
+1
vote
12
Generate atleast 3 solutions for 5 x 5 queen problem
answered
Apr 20
in
Algorithms

50
views
queenproblem
backtracking
algorithms
+4
votes
13
theory of computation
How many of them below are equivalent to (a+b)* ? A) (a*b)*a* B) (b*a)*b* C) a*(ba*)* D) b*(ab*)*
answered
Apr 15
in
Theory of Computation

48
views
theoryofcomputation
toc
#regularexpressions
+2
votes
14
Timothy Williams Question
The machine pictured in fig a)complements a given bit pattern b)finds 2's complement c)increments a given bit pattern by 1 d)changes the sign bit
answered
Apr 15
in
Theory of Computation

63
views
+1
vote
15
c pointers
main() { char *p1="name"; char *p2; p2=(char*)malloc(20); memset(p2,0,20); while(*p2++=*p1++); printf("%s\n",p2); }
answered
Apr 14
in
Programming

64
views
+1
vote
16
Rosen chapter6 (counting)
How many solutions are there to the equation x1 + x2 + x3 + x4 + x5 = 21, where xi , i = 1, 2, 3, 4, 5, is a nonnegative integer such that: 0$\leq$ x1$\leq$10 ?
answered
Apr 14
in
Combinatory

146
views
discretemathematics
kennethrosen
0
votes
17
Probability Exercise
The chess club of two school consists of 8 and 9 players.4 member from each club are randomly chosen to participate in a competition of two school.chosen player from one team are then randomly paired against chosen players of another team ... will be paired 2.Rebecca and Elise will be chosen to play but they will NOT be paired against Each Other
answered
Apr 11
in
Probability

80
views
probability
+2
votes
18
GATEBOOK TEST
1 +2(1/2) +3(1/4)+ 4(1/8)+ .............. = ? getting 2 please check
answered
Apr 10
in
Numerical Ability

87
views
+3
votes
19
C programming
answered
Apr 9
in
Programming

121
views
programminginc
+3
votes
20
ISI 2004 MIII
Q23 If $\textit{f}(x)=x^{2}$ and g(x)=x sinx +cosx then A) f and g agree at no point B) f and g agree at exactly one point C) f and g agree at exactly two point D) f and g agree at more then two point
answered
Apr 7
in
Calculus

51
views
isi2004
engineeringmathematics
0
votes
21
logic
can somebody explain the intution behind this ...? i am not able to get ....and i dont want to byheart ....
answered
Apr 7
in
Mathematical Logic

112
views
discretemathematics
propositionallogic
engineeringmathematics
mathematicallogic
+3
votes
22
Gate math book
Find the sum of n terms of the series $log a+ log \frac{a^{2}}{b} + log \frac{a^{3}}{b^{2}}+ ...$ to n terms
answered
Apr 5
in
Mathematical Logic

59
views
engineeringmathematics
+2
votes
23
Dynamic declaration of 2D array
answered
Apr 5
in
Programming

59
views
programminginc
+3
votes
24
theory of computation
Is the language given below regular or not ? I feel it is regular. The equivalent language is, L = {anblak ; n>=1,l>=1,k>=1 }  { a1b1a1 , a1b1a2 , a1b1a3 , a1b2a1 , a1b2a2 , a1b3a1 and few more strings (but ... is regular ... QUESTION TAKEN FROM PETER LINZ TEXTBOOK AND ANSWER WAS NOT GIVEN. So please verify whether i am correct ...???
answered
Apr 4
in
Theory of Computation

47
views
theoryofcomputation
toc
#finiteautomata
0
votes
25
ISI 2004 MIII
Q14 The inequality $\frac{2gx+x^{2}}{1x+x^{2}}\leq 3$ is true for all the value of x if and only if A) $1\leq g\leq 7$ B) $1\leq g\leq 1$ C) $6\leq g\leq 7$ D) $1\leq g\leq 7$
answered
Apr 4
in
Set Theory & Algebra

82
views
isi2004
inequality
+1
vote
26
CIL 2017
Which of the following operators can be used if a portion of a given bit patterns needs to be copied to a new word,while the remainder of the new word is filled with 0s? 1. Bitwise AND 2. Bitwise OR 3. Bitwise XOR 4. Bitwise AND
answered
Apr 2
in
Digital Logic

61
views
cil2017
+6
votes
27
GATE2006IT49
Which one of the choices given below would be printed when the following program is executed ? #include <stdio.h> struct test { int i; char *c; }st[] = {5, "become", 4, "better", 6, "jungle", 8, "ancestor", 7, ... > c); } jungle, n, 8, nclastor etter, u, 6, ungle cetter, k, 6, jungle etter, u, 8, ncestor
answered
Apr 1
in
Programming

1.1k
views
gate2006it
programming
programminginc
normal
+2
votes
28
Ravi asked his neighbor to water a delicate plant while he is away.
answered
Mar 27
in
Probability

68
views
probability
+1
vote
29
A bit string is called legitimate if it contains no consecutive zeros, e.g., 0101110 is legitimate,
answered
Mar 27
in
Combinatory

63
views
combinatorics
+1
vote
30
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
Mar 26
in
Algorithms

56
views
+2
votes
31
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
Mar 25
in
Theory of Computation

43
views
cfg
contextfree
theoryofcomputation
+2
votes
32
error in the code
why is it showing error?? #include <stdio.h> int main() { extern int i; i=20; printf("%d",i); }
answered
Mar 24
in
Programming

83
views
programminginc
+1
vote
33
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; }
answered
Mar 24
in
Programming

133
views
+3
votes
34
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
Mar 23
in
Algorithms

108
views
timecomplexity
algorithms
0
votes
35
ISI PCB 2014 C3 (A)
Prove that the language {aN : N is a composite number} is not regular.
answered
Mar 23
in
Theory of Computation

55
views
+4
votes
36
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

67
views
theoryofcomputation
grammar
+1
vote
37
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!$
answered
Mar 21
in
Algorithms

397
views
gate2005
algorithms
spacecomplexity
normal
+1
vote
38
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

74
views
theoryofcomputation
grammar
0
votes
39
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

61
views
theoryofcomputation
grammar
+3
votes
40
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!
answered
Mar 18
in
Programming

124
views
programminginc
Page:
1
2
3
4
5
6
...
9
next »
22,717
questions
29,045
answers
65,029
comments
27,454
users