Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Filter
ayushsomani
Wall
Recent activity
All questions
All answers
Exams Taken
All Blogs
Recent activity by ayushsomani
6
answers
1
GATE CSE 2008 | Question: 73
Consider a machine with a $2$-way set associative data cache of size $64$ Kbytes and block size $16$ bytes. The cache is managed using $32$ bit virtual addresses and the page size is $4$ Kbytes. A program to be run on this machine begins as follows: double ARR[ ... to array $\text{ARR}$. The cache hit ratio for this initialization loop is: $0\%$ $25\%$ $50\%$ $75\%$
Consider a machine with a $2$-way set associative data cache of size $64$ Kbytes and block size $16$ bytes. The cache is managed using $32$ bit virtual addresses and the ...
8.3k
views
commented
Feb 4, 2020
CO and Architecture
gatecse-2008
co-and-architecture
cache-memory
normal
+
–
12
answers
2
GATE CSE 2015 Set 2 | Question: 10
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
A binary tree T has $20$ leaves. The number of nodes in T having two children is ______.
30.0k
views
commented
Jan 23, 2020
DS
gatecse-2015-set2
data-structures
binary-tree
normal
numerical-answers
+
–
7
answers
3
GATE CSE 2017 Set 1 | Question: 20
Let $T$ be a tree with $10$ vertices. The sum of the degrees of all the vertices in $T$ is ________
Let $T$ be a tree with $10$ vertices. The sum of the degrees of all the vertices in $T$ is ________
18.7k
views
commented
Jan 23, 2020
DS
gatecse-2017-set1
data-structures
tree
easy
numerical-answers
+
–
8
answers
4
GATE CSE 2014 Set 3 | Question: 39
Suppose we have a balanced binary search tree $T$ holding $n$ numbers. We are given two numbers $L$ and $H$ and wish to sum up all the numbers in $T$ that lie between $L$ and $H$. Suppose there are $m$ such numbers in $T$. If the tightest upper bound on the time to compute the sum is $O(n^a\log^bn+m^c\log^dn)$, the value of $a+10b+100c+1000d$ is ______.
Suppose we have a balanced binary search tree $T$ holding $n$ numbers. We are given two numbers $L$ and $H$ and wish to sum up all the numbers in $T$ that lie between $L$...
31.2k
views
commented
Jan 21, 2020
DS
gatecse-2014-set3
data-structures
binary-search-tree
numerical-answers
normal
+
–
7
answers
5
TIFR CSE 2014 | Part B | Question: 9
Given a set of $n$ distinct numbers, we would like to determine the smallest three numbers in this set using comparisons. Which of the following statements is TRUE? These three elements can be determined using $O\left(\log^{2}n\right)$ ... $O(n)$ comparisons. None of the above.
Given a set of $n$ distinct numbers, we would like to determine the smallest three numbers in this set using comparisons. Which of the following statements is TRUE?These ...
9.7k
views
commented
Jan 20, 2020
Algorithms
tifr2014
algorithms
maximum-minimum
+
–
16
answers
6
GATE CSE 2014 Set 1 | Question: 39
The minimum number of comparisons required to find the minimum and the maximum of $100$ numbers is ________
The minimum number of comparisons required to find the minimum and the maximum of $100$ numbers is ________
53.6k
views
commented
Jan 20, 2020
Algorithms
gatecse-2014-set1
algorithms
numerical-answers
normal
maximum-minimum
+
–
3
answers
7
GATE CSE 2014 Set 2 | Question: 52
The number of distinct minimum spanning trees for the weighted graph below is _____
The number of distinct minimum spanning trees for the weighted graph below is _____
13.5k
views
commented
Jan 11, 2020
Algorithms
gatecse-2014-set2
algorithms
spanning-tree
numerical-answers
normal
+
–
2
answers
8
TIFR CSE 2015 | Part B | Question: 3
Consider the following code fragment in the $C$ programming language when run on a non-negative integer $n$. int f (int n) { if (n==0 || n==1) return 1; else return f (n - 1) + f(n - 2); } Assuming a typical implementation ... $n$. This algorithm runs in polynomial time in $n$ and the optimal running time is polynomial in $n$. The algorithm does not terminate.
Consider the following code fragment in the $C$ programming language when run on a non-negative integer $n$.int f (int n) { if (n==0 || n==1) return 1; else return f (n -...
1.8k
views
commented
Jan 2, 2020
Algorithms
tifr2015
algorithms
identify-function
time-complexity
+
–
8
answers
9
GATE CSE 1991 | Question: 01,x
Consider the following recursive definition of $fib$: fib(n) := if n = 0 then 1 else if n = 1 then 1 else fib(n-1) + fib(n-2) The number of times $fib$ is called (including the first call) for evaluation of $fib(7)$ is___________.
Consider the following recursive definition of $fib$:fib(n) := if n = 0 then 1 else if n = 1 then 1 else fib(n-1) + fib(n-2)The number of times $fib$ is called (includin...
10.1k
views
commented
Dec 28, 2019
Programming in C
gate1991
programming
recursion
normal
numerical-answers
+
–
8
answers
10
GATE CSE 2005 | Question: 32
Consider the following C program: double foo (double); /* Line 1 */ int main() { double da, db; //input da db = foo(da); } double foo (double a) { return a; } The above code compiled without any error ... or error some compiler-warnings not leading to unintended results some compiler-warnings due to type-mismatch eventually leading to unintended results compiler errors
Consider the following C program:double foo (double); /* Line 1 */ int main() { double da, db; //input da db = foo(da); } double foo (double a) { return a; }The above cod...
16.0k
views
commented
Dec 28, 2019
Programming in C
gatecse-2005
programming
programming-in-c
compiler-design
easy
+
–
6
answers
11
GATE IT 2005 | Question: 53
The following$ C$ function takes two ASCII strings and determines whether one is an anagram of the other. An anagram of a string s is a string obtained by permuting the letters in s. int anagram (char *a, char *b) { int count [128], j; for (j = 0; j < 128; j++) count[j] = 0; j ... [j]]++ A: count [a[j++]]++ and B: count[b[j]]-- A: count [a[j]]++ and B: count[b[j++]]--
The following$ C$ function takes two ASCII strings and determines whether one is an anagram of the other. An anagram of a string s is a string obtained by permuting the l...
12.0k
views
commented
Dec 28, 2019
Algorithms
gateit-2005
normal
identify-function
+
–
2
answers
12
GATE IT 2008 | Question: 52
C program is given below: # include <stdio.h> int main () { int i, j; char a [2] [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}}; char b [3] [2]; char *p = *b; for (i = 0; i < 2; i++) { for (j = 0; j < ... $\text{b e}$ $\text{c f}$ $\text{a c}$ $\text{e b}$ $\text{d f}$ $\text{a e}$ $\text{d c}$ $\text{b f}$
C program is given below:# include <stdio.h int main () { int i, j; char a [3] = {{'a', 'b', 'c'}, {'d', 'e', 'f'}}; char b [3] ; char *p = *b; for (i = 0; i < 2; i++)...
10.4k
views
comment edited
Dec 27, 2019
Programming in C
gateit-2008
programming
programming-in-c
normal
array
+
–
3
answers
13
GATE CSE 2017 Set 2 | Question: 17
An ER model of a database consists of entity types $A$ and $B$. These are connected by a relationship $R$ which does not have its own attribute. Under which one of the following conditions, can the relational table for R be merged with that of A? Relationship ... of $A$ in $R$ is total Relationship $R$ is many-to-one and the participation of $A$ in $R$ is partial
An ER model of a database consists of entity types $A$ and $B$. These are connected by a relationship $R$ which does not have its own attribute. Under which one of the fo...
22.2k
views
commented
Dec 23, 2019
Databases
gatecse-2017-set2
databases
er-diagram
normal
+
–
6
answers
14
GATE CSE 2008 | Question: 82
Consider the following $\text{ER}$ diagram The minimum number of tables needed to represent $M$, $N$, $P$, $R1$, $R2$ is $2$ $3$ $4$ $5$
Consider the following $\text{ER}$ diagramThe minimum number of tables needed to represent $M$, $N$, $P$, $R1$, $R2$ is$2$$3$$4$$5$
26.2k
views
commented
Dec 23, 2019
Databases
gatecse-2008
databases
er-diagram
normal
+
–
4
answers
15
GATE CSE 2005 | Question: 75
Let $E_1$ and $E_2$ be two entities in an $E/R$ diagram with simple-valued attributes. $R_1$ and $R_2$ are two relationships between $E_1$ and $E_2$, where $R_1$ is one-to-many and $R_2$ is many-to-many. $R_1$ and $R_2$ do not have ... of their own. What is the minimum number of tables required to represent this situation in the relational model? $2$ $3$ $4$ $5$
Let $E_1$ and $E_2$ be two entities in an $E/R$ diagram with simple-valued attributes. $R_1$ and $R_2$ are two relationships between $E_1$ and $E_2$, where $R_1$ is one-t...
18.2k
views
commented
Dec 23, 2019
Databases
gatecse-2005
databases
er-diagram
normal
+
–
5
answers
16
GATE CSE 2008 | Question: 69
Consider the following relational schemes for a library database: Book (Title, Author, Catalog_no, Publisher, Year, Price) Collection(Title, Author, Catalog_no) with the following functional dependencies: $\text{Title Author }\rightarrow\text{ Catalog_no}$ ... $\text{2NF}$ and Collection in $\text{3NF}$ Both Book and Collection are in $\text{2NF}$ only
Consider the following relational schemes for a library database:Book (Title, Author, Catalog_no, Publisher, Year, Price) Collection(Title, Author, Catalog_no)with the fo...
27.7k
views
commented
Dec 23, 2019
Databases
gatecse-2008
databases
database-normalization
normal
+
–
3
answers
17
Self doubt
The number of tables required in SELF-REFERENTIAL relation when different mappings(1: M, M:1, 1:1, M: N) are used with different participation (Partial Participation at both sides, Total Participation at both sides and partial participation at one side). (Tabular Format answer will be appreciated).
The number of tables required in SELF-REFERENTIAL relation when different mappings(1: M, M:1, 1:1, M: N) are used with different participation (Partial Participation at b...
6.4k
views
commented
Dec 20, 2019
Databases
databases
er-diagram
+
–
2
answers
18
recursive descent parsers
Are recursive descent parsers with backtracking or without?
Are recursive descent parsers with backtracking or without?
2.9k
views
comment edited
Dec 18, 2019
Theory of Computation
compiler-design
parsing
+
–
4
answers
19
GATE CSE 2014 Set 3 | Question: 17
One of the purposes of using intermediate code in compilers is to make parsing and semantic analysis simpler. improve error recovery and error reporting. increase the chances of reusing the machine-independent code optimizer in other compilers. improve the register allocation.
One of the purposes of using intermediate code in compilers is tomake parsing and semantic analysis simpler.improve error recovery and error reporting.increase the chance...
9.1k
views
commented
Dec 17, 2019
Compiler Design
gatecse-2014-set3
compiler-design
intermediate-code
easy
+
–
3
answers
20
GATE CSE 2008 | Question: 11
Which of the following describes a handle (as applicable to LR-parsing) appropriately? It is the position in a sentential form where the next shift or reduce operation will occur It is non-terminal whose production will be used for reduction in the ... in the next step along with a position in the sentential form where the right hand side of the production may be found
Which of the following describes a handle (as applicable to LR-parsing) appropriately?It is the position in a sentential form where the next shift or reduce operation wil...
13.3k
views
commented
Dec 17, 2019
Compiler Design
gatecse-2008
compiler-design
parsing
normal
+
–
3
answers
21
GATE CSE 2008 | Question: 55
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only if The SLR(1) parser for G has S-R conflicts The LR(1) parser for G has S-R conflicts The LR(0) parser for G has S-R conflicts The LALR(1) parser for G has reduce-reduce conflicts
An LALR(1) parser for a grammar G can have shift-reduce (S-R) conflicts if and only ifThe SLR(1) parser for G has S-R conflictsThe LR(1) parser for G has S-R conflictsThe...
15.7k
views
commented
Dec 17, 2019
Compiler Design
gatecse-2008
compiler-design
parsing
normal
+
–
1
answer
22
GATE CSE 1989 | Question: 8b
Indicate the result of the following program if the language uses (i) static scope rules and (ii) dynamic scope rules. var x, y:integer; procedure A (var z:integer); var x:integer; begin x:=1; B; z:= x end; procedure B; begin x:=x+1 end; begin x:=5; A(y); write (y) ...end.
Indicate the result of the following program if the language uses (i) static scope rules and (ii) dynamic scope rules.var x, y:integer; procedure A (var z:integer); var x...
1.5k
views
commented
Dec 17, 2019
Compiler Design
gate1989
descriptive
compiler-design
runtime-environment
+
–
1
answer
23
GATE CSE 1992 | Question: 11a
Write syntax directed definitions (semantic rules) for the following grammar to add the type of each identifier to its entry in the symbol table during semantic analysis. Rewriting the grammar is not permitted and semantic rules are to be added to the ends of productions ... $T \rightarrow \text{int}$ $T \rightarrow \text{real}$ $L \rightarrow L,id$ $L \rightarrow id$
Write syntax directed definitions (semantic rules) for the following grammar to add the type of each identifier to its entry in the symbol table during semantic analysis....
3.1k
views
commented
Dec 16, 2019
Compiler Design
gate1992
compiler-design
syntax-directed-translation
normal
descriptive
+
–
5
answers
24
GATE CSE 2017 Set 2 | Question: 05
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it: ... $\text{P-iii; Q-iv; R-i; S-ii}$ $\text{P-i; Q-iv; R-ii; S-iii}$
Match the following according to input (from the left column) to the compiler phase (in the right column) that processes it:$$\begin{array}{|l|l|}\hline \text{P. Syntax t...
9.5k
views
commented
Dec 15, 2019
Compiler Design
gatecse-2017-set2
compiler-design
match-the-following
compilation-phases
easy
+
–
1
answer
25
SDT-compiler
what is the output produced for the input "pqsqsr" using the top down parsing?Also what is the result if semantic actions are at right not in middle
what is the output produced for the input "pqsqsr" using the top down parsing?Also what is the result if semantic actions are at right not in middle
848
views
commented
Dec 14, 2019
Compiler Design
syntax-directed-translation
compiler-design
test-series
+
–
3
answers
26
GATE CSE 2004 | Question: 89
$L_1$ is a recursively enumerable language over $\Sigma$. An algorithm $A$ effectively enumerates its words as $\omega_1, \omega_2, \omega_3, \dots .$ Define another language $L_2$ over $\Sigma \cup \left\{\text{#}\right\}$ ... $S_1$ is true but $S_2$ is not necessarily true $S_2$ is true but $S_1$ is not necessarily true Neither is necessarily true
$L_1$ is a recursively enumerable language over $\Sigma$. An algorithm $A$ effectively enumerates its words as $\omega_1, \omega_2, \omega_3, \dots .$ Define another lang...
11.0k
views
commented
Dec 9, 2019
Theory of Computation
gatecse-2004
theory-of-computation
turing-machine
difficult
+
–
6
answers
27
GATE CSE 2005 | Question: 79
Consider the following data path of a $\text{CPU}.$ The $\text{ALU},$ the bus and all the registers in the data path are of identical size. All operations including incrementation of the $\text{PC}$ and the $\text{GPRs}$ are to be carried out in the ... $2$ $3$ $4$ $5$
Consider the following data path of a $\text{CPU}.$The $\text{ALU},$ the bus and all the registers in the data path are of identical size. All operations including increm...
24.1k
views
comment edited
Dec 9, 2019
CO and Architecture
gatecse-2005
co-and-architecture
machine-instruction
data-path
normal
+
–
1
answer
28
right and left quotient in regular language
how to find L1/L2 for some L1 and L2 (is diagram making must ) how to conclude that L1 is divisible or not divisible by L2
how to find L1/L2 for some L1 and L2 (is diagram making must )how to conclude that L1 is divisible or not divisible by L2
14.9k
views
commented
Dec 7, 2019
8
answers
29
GATE CSE 2006 | Question: 29
If $s$ is a string over $(0+1)^*$ then let $n_0(s)$ denote the number of $0$'s in $s$ and $n_1(s)$ the number of $1$'s in $s$. Which one of the following languages is not regular? $L=\left \{ s\in (0+1)^* \mid n_{0}(s) \text{ is a 3-digit prime } \right \}$ ... $L=\left \{ s\in (0+1)^*\mid n_{0}(s) \mod 7=n_{1}(s) \mod 5=0 \right \}$
If $s$ is a string over $(0+1)^*$ then let $n_0(s)$ denote the number of $0$’s in $s$ and $n_1(s)$ the number of $1$’s in $s$. Which one of the following languages i...
19.3k
views
commented
Dec 7, 2019
Theory of Computation
gatecse-2006
theory-of-computation
normal
regular-language
+
–
6
answers
30
GATE CSE 2014 Set 2 | Question: 36
Let $L_1=\{w\in\{0,1\}^*\mid w$ $\text{ has at least as many occurrences of }$ $(110)'\text{s as }$ $(011)'\text{s} \}$. Let $L_2=\{w \in\{0,1\}^*\ \mid w$ $ \text{ has at least as many occurrences of }$ ... is TRUE? $L_1$ is regular but not $L_2$ $L_2$ is regular but not $L_1$ Both $L_1$ and $L_2$ are regular Neither $L_1$ nor $L_2$ are regular
Let $L_1=\{w\in\{0,1\}^*\mid w$ $\text{ has at least as many occurrences of }$ $(110)'\text{s as }$ $(011)'\text{s} \}$. Let $L_2=\{w \in\{0,1\}^*\ \mid w$ $ \text{ has a...
24.9k
views
commented
Dec 7, 2019
Theory of Computation
gatecse-2014-set2
theory-of-computation
normal
regular-language
+
–
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register