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 srestha
User srestha
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
User srestha
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
0
answers
1
data structure
#include <stdio.h> void main() { int b = 5 + 7 * 4  9 * (3, 2); printf("%d", b); } how to solve this
commented
30 minutes
ago
in
Programming

2
views
2
answers
2
GATE2017131
Let $A$ be $n\times n$ real valued square symmetric matrix of rank 2 with $\sum_{i=1}^{n}\sum_{j=1}^{n}A^{2}_{ij} =$ 50. Consider the following statements. (I) One eigenvalue must be in $\left [ 5,5 \right ]$ (II) The eigenvalue with the largest ... $A$ is/are necessarily CORRECT? (A) Both (I) and (II) (B) (I) only (C) (II) only (D) Neither (I) nor (II)
commented
1 day
ago
in
Linear Algebra

928
views
gate20171
linearalgebra
eigenvalue
normal
1
answer
3
GATE19998
Let $A$ be an $n \times n$ matrix such that the elements in each row and each column are arranged in ascending order. Draw a decision tree, which finds 1st, 2nd and 3rd smallest elements in minimum number of comparisons.
commented
1 day
ago
in
Algorithms

245
views
gate1999
algorithms
normal
descriptive
3
answers
4
GATE2017113
Consider the following C code: #include<stdio.h> int *assignval (int *x, int val) { *x = val; return x; } void main () { int *x = malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,0); ... not as shown. (C) compiles successfully but execution may result in dangling pointer. (D) compiles successfully but execution may result in memory leak.
commented
1 day
ago
in
Programming

1.2k
views
gate20171
programminginc
programming
0
answers
5
Nested function in C
Function is a variable so declaration of a function precede function definition,SO #include<stdio.h> main( ) { void m( ) { printf ( "hi" ) ; } m(); } output: hi "Works correctly" but if #include<stdio.h> main ... ) { printf ( "hi" ) ; } there is type mismatch so it must throw error.BUT it runs correctly Why?
commented
1 day
ago
in
Programming & DS

28
views
3
answers
6
GATE2017136
Consider the C functions foo and bar given below: int foo(int val) { int x=0; while(val > 0) { x = x + foo(val); } return val; } int bar(int val) { int x = 0; while(val > 0) { x ... 6 and 6 respectively. (B) Infinite loop and abnormal termination respectively. (C) Abnormal termination and infinite loop respectively. (D) Both terminating abnormally.
commented
2 days
ago
in
Programming

1.2k
views
gate20171
programminginc
programming
normal
1
answer
7
Output of Code
#include <stdio.h> int main() { int a; char *x; x= (char *) &a; a=512; x[0]=1; x[1]=2; printf("%d\n",a); return 0; }
commented
2 days
ago
in
Programming

28
views
programminginc
1
answer
8
Hasse diagram
How come D66 is boolean algebra. Explain it through hasse diagram.
answer selected
2 days
ago
in
Set Theory & Algebra

14
views
1
answer
9
C programming
int a[20]; unsigned int m; // global variable int foo(int a[]) { int i=0,count = 0; while(i < 20) m = 1<<(a[i++]1); i = (sizeof(int)<<3)1; while(i>=0) if(m&(1<<(i))) count++; return ... in a[] which are more than $20$ B No of distinct elements in a[] which less than $20$ C No of distinct elements in a[] D None of these
commented
2 days
ago
in
Programming

140
views
programminginc
output
1
answer
10
Time Complexity
What will be the time complexity for the following equation: $$T(n)= 2^{n} T(\frac{n}{2}) +n^{n}$$
commented
3 days
ago
in
Algorithms

96
views
algorithms
timecomplexity
recursion
2
answers
11
GATE200861
Choose the correct option to fill ?1 and ?2 so that the program below prints an input string in reverse order. Assume that the input string is terminated by a new line character. void reverse(void) { int c; if(?1) reverse(); ?2 } main() { printf("Enter text"); ... (c != '\n') ?2 is putchar(c); ?1 is ((c = getchar() ) != '\n') ?2 is putchar(c);
commented
3 days
ago
in
Programming

459
views
gate2008
programming
normal
5
answers
12
GATE200840
The minimum number of comparisons required to determine if an integer appears more than $\frac{n}{2}$ times in a sorted array of $n$ integers is $\Theta(n)$ $\Theta(\log n)$ $\Theta(\log^*n)$ $\Theta(1)$
commented
3 days
ago
in
Algorithms

1.8k
views
gate2008
normal
algorithms
2
answers
13
programming
Observe the unlabelled binary tree given below. The number of ways of inserting the values 1 ,2,3,4,5,6 in a Binary Search Tree such that the resultant BST takes the structure of the Binary tree given above ?
answered
3 days
ago
in
DS

19
views
0
answers
14
Combinatorics : Multinomial Coefficients
commented
4 days
ago
in
Combinatory

37
views
permutationsandcombinations
discretemathematics
engineeringmathematics
polynomials
1
answer
15
Programming
int sum(int array[ ] , int n){ int sum=0; for (int i=0:i<n;i++{ sum=sum+array[i]; } return sum; What will be the space complexity for above code??
commented
4 days
ago
in
Programming

22
views
1
answer
16
rosen graph theory
find the values (k tuple coloring ) 1)$X_{2}(K_{3}) 2. X_{3}(K_{5})$
answer selected
4 days
ago
in
Graph Theory

21
views
2
answers
17
GATE2016Session7GA8
Fact 1: Humans are mammals. Fact 2: Some humans are engineers. Fact 3: Engineers build houses. If the above statements are facts, which of the following can be logically inferred? I. All mammals build houses. II. Engineers are mammals. III. Some humans are not engineers. II only. III only. I, II and III. I only.
commented
4 days
ago
in
Numerical Ability

89
views
gate2016session7aptitude
logicalreasoning
7
answers
18
GATE 2016135
What will be the output of the following $C$ program? void count (int n) { static int d=1; printf ("%d",n); printf ("%d",d); d++; if (n>1) count (n1); printf ("%d",d); } void main(){ count (3); } $3 \ 1 \ 2 \ 2 \ 1 \ 3 \ 4 \ 4 \ 4$ $3 \ 1 \ 2 \ 1 \ 1 \ 1 \ 2 \ 2 \ 2$ $3 \ 1 \ 2 \ 2 \ 1 \ 3 \ 4$ $3 \ 1 \ 2 \ 1 \ 1 \ 1 \ 2$
commented
4 days
ago
in
Programming

1.9k
views
gate20161
programminginc
recursion
normal
1
answer
19
programming
We want to write a code snippet to find if a given sequence of parentheses containing only ( and )' is balanced one. The input character sequence is given in a character array arr[]. We have a stack which holds character value. The standard operations in stack are s.pop()  ... arr[i]); S1: arr[i]==') && s.top()==')' S2: s.push(arr[i]) S3: s.pop()
commented
4 days
ago
in
DS

33
views
4
answers
20
TIFR2017B3
We have an implementation that supports the following operations on a stack (in the instructions below, $\mathsf{s}$ is the name of the stack). $\mathsf{isempty(s)}$ : returns $\mathsf{True}$ if $\mathsf{s}$ is empty, and $\mathsf{False}$ otherwise. $\mathsf{top(s)}$ ... pop_ray_pop("(((()((())((((") is executed? (((( ))) (((( ))) (((())) ()()
answer selected
4 days
ago
in
DS

145
views
tifr2017
datastructure
stack
2
answers
21
Predict the output
#include <stdio.h> void f(int); int main() { int a=4; f(a); return 0; } void f(int n) { if(n>0) { f(n); printf("%d", n); f(n); } } Explain how function calls take place
commented
4 days
ago
in
Programming

26
views
recursion
1
answer
22
Derangements
How many ways we can put 5 letters L1, L2, L3, L4, L5 in 5 envelopes e1, e2, e3, e4 and e5 (at 1 letter per envelope) so that i. no letter is correctly placed? ii. at least 1 letter is correctly placed? iii. exactly 2 letters ... placed? iv. at most 1 letter is correctly placed? v. at least 1 letter is wrongly placed? vi. exactly 1 letter is wrongly placed?
commented
4 days
ago
in
Combinatory

27
views
discretemathematics
permutationsandcombinations
derangements
4
answers
23
GATE 2016133
Consider a carry look ahead adder for adding two nbit integers, built using gates of fanin at most two. The time to perform addition using this adder is $\Theta (1)$ $\Theta (\log(n))$ $\Theta (\sqrt{n})$ $\Theta (n)$)
commented
5 days
ago
in
Digital Logic

2.6k
views
gate20161
digitallogic
adder
normal
4
answers
24
GATE2007IT30
Suppose you are given an implementation of a queue of integers. The operations that can be performed on the queue are: isEmpty (Q)  returns true if the queue is empty, false otherwise. delete (Q)  deletes the element at the front of ... the front of the queue Q and inserts it at the rear keeping the other elements in the same order Empties the queue Q
commented
Jun 21
in
DS

619
views
gate2007it
datastructure
queues
normal
1
answer
25
Plz explain
. Consider these 2 statements: S1: LR = L, if and only if L is the language of palindromes. where LR is obtained by reversing all the strings of L. S2:  L1∙ L2  =  L1  ×  L2  Relation? (a) Both are F (b) Both are T 2 (c) S1 → T, S2 → F (d) S1 → F, S2 → T
commented
Jun 20
in
Theory of Computation

105
views
badquestion
2
answers
26
Programmin
main() { char check ='a'; switch(check) { case 'a'1:printf("gats"); case 'b'  2: printf("quiz"); break; default :printf("Gatesquiz"); } } a)gates b)gatesquiz c)gatesquizgatesquiz d)compiler error
commented
Jun 15
in
Programming

37
views
1
answer
27
const pointer
The output of below code is_______________. int main() { int i = 120; int *a = &i; foo(&a); printf("%d ", *a); printf("%d ", *a); } void foo(int **const a) { int j = 210; *a = &j; printf("%d ", **a);
answer selected
Jun 14
in
Programming

91
views
4
answers
28
GATE2005IT36
Let $P(x)$ and $Q(x)$ be arbitrary predicates. Which of the following statements is always TRUE? $\left(\left(\forall x \left(P\left(x\right) \vee Q\left(x\right)\right)\right)\right) \implies \left(\left(\forall x P\left(x\right)\ ... )\right)\right) \right) \implies \left(\forall x \left (P\left(x\right) \Leftrightarrow Q\left(x\right)\right)\right)$
commented
Jun 14
in
Mathematical Logic

1.2k
views
gate2005it
mathematicallogic
firstorderlogic
normal
4
answers
29
GATE20171GA1
After Rajendra Chola returned from his voyage to Indonesia, he ________ to visit the temple in Thanjavur. (A) was wishing (B) is wishing (C) wished (D) had wished
answered
Jun 14
in
Verbal Ability

1.3k
views
gate20171
verbalability
tenses
englishgrammar
normal
3
answers
30
GATE2005IT33
Let $A$ be a set with $n$ elements. Let $C$ be a collection of distinct subsets of $A$ such that for any two subsets $S_1$ and $S_2$ in $C$, either $S_1 \subset S_2$ or $S_2\subset S_1$. What is the maximum cardinality of C? $n$ $n+1$ $2^{n1} + 1$ $n!$
commented
Jun 14
in
Set Theory & Algebra

707
views
gate2005it
settheory&algebra
normal
sets
1
answer
31
LL(1) Grammer
S > (L)  a L > L . S  S Question: Make necessary changes to make it suitable for LL(1) parsing and Construct FIRST and FOLLOW sets.
answer edited
Jun 14
in
Compiler Design

47
views
compilerdesign
grammar
ll1
parsing
1
answer
32
time and work
Two pipes A and B can fill tank in 10 and 20 min respectively.if both pipes are opened simultaneously ,after how many minutes should pipe B be closed so that the tank is full in 8 min? Ans: 4 min
answer selected
Jun 14
in
Verbal Ability

32
views
worktime
2
answers
33
GATE 2016228
Consider a set $U$ of $23$ different compounds in a chemistry lab. There is a subset $S$ of $U$ of $9$ compounds, each of which reacts with exactly $3$ compounds of $U$. Consider the following statements: Each compound in U \ S reacts with ... with an even number of compounds. Which one of the above statements is ALWAYS TRUE? Only I Only II Only III None.
commented
Jun 14
in
Set Theory & Algebra

1.7k
views
gate20162
settheory&algebra
difficult
sets
2
answers
34
Counting
How many ways are there to put six temporary employees into four labeled offices so that there is at least one temporary employee in each of these four offices?
answered
Jun 14
in
Mathematical Logic

33
views
permutationsandcombinations
counting
4
answers
35
GATE2005IT34
Let n = p2q, where p and q are distinct prime numbers. How many numbers m satisfy 1 ≤ m ≤ n and gcd (m, n) = 1? Note that gcd (m, n) is the greatest common divisor of m and n. p(q  1) pq (p2 1) (q  1) p(p  1) (q  1)
commented
Jun 13
in
Set Theory & Algebra

503
views
gate2005it
settheory&algebra
normal
numbertheory
1
answer
36
GATE1998_2.3
The binary relation $R = \{(1, 1), (2, 1), (2, 2), (2, 3), (2, 4), (3, 1), (3, 2), (3, 3), (3, 4)\}$ on the set $A=\{1, 2, 3, 4\}$ is reflective, symmetric and transitive neither reflective, nor irreflexive but transitive irreflexive, symmetric and transitive irreflexive and antisymmetric
commented
Jun 13
in
Set Theory & Algebra

276
views
gate1998
settheory&algebra
easy
relations
2
answers
37
Generating FunctionRosen
Find the coefficient of x10 $\left ( 1+x^{2}+x^{4}+........ \right )\left ( 1+x^{4}+x^{8}+..... \right )\left ( 1+x^{6}+x^{12}..... \right )$
commented
Jun 13
in
Calculus

66
views
generatingfunctions
1
answer
38
DSSB_2017
Which contains the information about a file that is needed by the system programs that access the file records? 1.A file header 2.A file descriptor 3.Bootstrap 4.Both 1 and 2
answer selected
Jun 13
in
Operating System

44
views
operatingsystem
databases
programminginc
1
answer
39
How to solve such problem?
How many solution exist for x+y+z=10 with 1<=x<4 1<=y<=7 and z>1
comment edited
Jun 13
in
Combinatory

171
views
permutationsandcombinations
2
answers
40
GATE1998_10
Prove by induction that the expression for the number of diagonals in a polygon of $n$ sides is $\frac{n(n3)}{2}$ Let $R$ be a binary relation on $A = \{a, b, c, d, e, f, g, h\}$ represented by the following two component digraph. Find the smallest integers $m$ and $n$ such that $m < n$ and $R^m = R^n$.
answer selected
Jun 13
in
Set Theory & Algebra

276
views
gate1998
settheory&algebra
descriptive
relations
23,428
questions
30,143
answers
67,576
comments
28,472
users