Login
Register
Dark Mode
Brightness
Profile
Edit Profile
Messages
My favorites
My Updates
Logout
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Most answered questions in Programming and DS
50
votes
9
answers
41
GATE CSE 2014 Set 3 | Question: 12
Consider the following rooted tree with the vertex labeled $P$ as the root: The order in which the nodes are visited during an in-order traversal of the tree is $SQPTRWUV$ $SQPTUWRV$ $SQPTWUVR$ $SQPTRUWV$
Consider the following rooted tree with the vertex labeled $P$ as the root:The order in which the nodes are visited during an in-order traversal of the tree is$SQPTRWUV$$...
go_editor
16.5k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set3
data-structures
tree
easy
+
–
54
votes
9
answers
42
GATE CSE 2014 Set 2 | Question: 41
Suppose a stack implementation supports an instruction $\text{REVERSE}$, which reverses the order of elements on the stack, in addition to the $\text{PUSH}$ and $\text{POP}$ ... instruction. A queue can be implemented where both $\text{ENQUEUE}$ and $\text{DEQUEUE}$ take a single instruction each.
Suppose a stack implementation supports an instruction $\text{REVERSE}$, which reverses the order of elements on the stack, in addition to the $\text{PUSH}$ and $\text{PO...
go_editor
24.9k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set2
data-structures
stack
easy
+
–
52
votes
9
answers
43
GATE CSE 2013 | Question: 50
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $A$. The characters to be replaced are supplied in array $oldc$ ... given above, how many test cases will be able to capture the flaw? Only one Only two Only three All four
The procedure given below is required to find and replace certain characters inside an input character string supplied in array $A$. The characters to be replaced are sup...
Arjun
14.4k
views
Arjun
asked
Sep 24, 2014
DS
gatecse-2013
data-structures
array
normal
+
–
43
votes
9
answers
44
GATE CSE 2000 | Question: 1.16
Aliasing in the context of programming languages refers to multiple variables having the same memory location multiple variables having the same value multiple variables having the same identifier multiple uses of the same variable
Aliasing in the context of programming languages refers tomultiple variables having the same memory locationmultiple variables having the same valuemultiple variables hav...
Kathleen
24.8k
views
Kathleen
asked
Sep 14, 2014
Programming in C
gatecse-2000
programming
easy
aliasing
+
–
81
votes
9
answers
45
GATE CSE 2013 | Question: 44
Consider the following operation along with Enqueue and Dequeue operations on queues, where $k$ is a global parameter. MultiDequeue(Q){ m = k while (Q is not empty) and (m > 0) { Dequeue(Q) m = m – 1 } } What is the worst case time complexity of a sequence of $n$ queue operations on an initially empty queue? $Θ(n)$ $Θ(n + k)$ $Θ(nk)$ $Θ(n^2)$
Consider the following operation along with Enqueue and Dequeue operations on queues, where $k$ is a global parameter.MultiDequeue(Q){ m = k while (Q is not empty) and (m...
gatecse
31.4k
views
gatecse
asked
Aug 7, 2014
DS
gatecse-2013
data-structures
algorithms
normal
queue
+
–
1
votes
8
answers
46
UGC NET CSE | June 2005 | Part 2 | Question: 12
Find the output of the following $“C”$ code : Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); } $55, 93$ $53, 97$ $56, 95$ $57, 94$
Find the output of the following $“C”$ code :Main() { int x=20, y=35; x=y++ + x++; y=++y + ++x; printf (“%d, %d\n”, x, y); }$55, 93$$53, 97$$56, 95$$57, 94$
go_editor
2.3k
views
go_editor
asked
Mar 26, 2020
Programming in C
ugcnetcse-june2005-paper2
programming-in-c
variable-scope
+
–
13
votes
8
answers
47
Two dimensional array
Consider a 2 dimensional array A[40...95,40...95] in lower triangular matrix representation. The size of each element of array is 1 Byte.If array is implemented in memory as Row major,with base address as 1000,the address of A[66][50] is ..... Ans. 1361
Consider a 2 dimensional array A[40...95,40...95] in lower triangular matrix representation. The size of each element of array is 1 Byte.If array is implemented in memory...
Na462
5.6k
views
Na462
asked
Aug 22, 2018
DS
programming-in-c
array
pointers
data-structures
+
–
0
votes
8
answers
48
UGC NET CSE | July 2018 | Part 2 | Question: 26
A binary search tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 19 leaves: cannot have more than 37 nodes has exactly 37 nodes has exactly 35 nodes cannot have more than 35 nodes
A binary search tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 19 leaves:cannot have more than...
Pooja Khatri
3.6k
views
Pooja Khatri
asked
Jul 13, 2018
DS
ugcnetcse-july2018-paper2
data-structures
binary-search-tree
+
–
17
votes
8
answers
49
Heap..
1)The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________. -------------------------------------------------------------------------------------------------------------------------- 2)The number of min heap trees are possible with 15 elements_________________
1)The number of min heap trees are possible with 15 elements such that every leaf node must be greater than all non-leaf nodes of the tree are ________. 2)The...
srestha
7.5k
views
srestha
asked
Jan 3, 2017
Programming in C
binary-heap
+
–
13
votes
8
answers
50
ISRO2015-69
If n has 3, then the statement a[++n]=n++; assigns 3 to a[5] assigns 4 to a[5] assigns 4 to a[4] what is assigned is compiler dependent
If n has 3, then the statement a[++n]=n++;assigns 3 to a[5]assigns 4 to a[5]assigns 4 to a[4]what is assigned is compiler dependent
milankamilya
8.6k
views
milankamilya
asked
Jun 14, 2016
Programming in C
isro2015
programming-in-c
non-gate
undefined-behaviour
+
–
29
votes
8
answers
51
TIFR CSE 2012 | Part B | Question: 15
Let $T$ be a tree of $n$ nodes. Consider the following algorithm, that constructs a sequence of leaves $u_{1}, u_{2}...$. Let $u_{1}$ be some leaf of tree. Let $u_{2}$be a leaf that is farthest from $u_{1}$ ... . For the same tree, the distance between the last two vertices visited can be different, based on the choice of the first leaf $u_{1}$.
Let $T$ be a tree of $n$ nodes. Consider the following algorithm, that constructs a sequence of leaves $u_{1}, u_{2}...$. Let $u_{1}$ be some leaf of tree. Let $u_{2}$be ...
makhdoom ghaya
3.8k
views
makhdoom ghaya
asked
Nov 2, 2015
DS
tifr2012
data-structures
tree
+
–
25
votes
8
answers
52
GATE CSE 2015 Set 3 | Question: 13
While inserting the elements $71, 65, 84, 69, 67, 83$ in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is $65$ $67$ $69$ $83$
While inserting the elements $71, 65, 84, 69, 67, 83$ in an empty binary search tree (BST) in the sequence shown, the element in the lowest level is$65$$67$$69$$83$
go_editor
7.4k
views
go_editor
asked
Feb 14, 2015
DS
gatecse-2015-set3
data-structures
binary-search-tree
easy
+
–
48
votes
8
answers
53
GATE CSE 2015 Set 3 | Question: 7
Consider the following C program segment. # include <stdio.h> int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); } What will be printed by the program? $12$ $120400$ $1204$ $1034$
Consider the following C program segment.# include <stdio.h int main() { char s1[7] = "1234", *p; p = s1 + 2; *p = '0'; printf("%s", s1); }What will be printed by the pro...
go_editor
16.3k
views
go_editor
asked
Feb 14, 2015
Programming in C
gatecse-2015-set3
programming
programming-in-c
normal
array
+
–
119
votes
8
answers
54
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$...
go_editor
31.6k
views
go_editor
asked
Sep 28, 2014
DS
gatecse-2014-set3
data-structures
binary-search-tree
numerical-answers
normal
+
–
88
votes
8
answers
55
GATE CSE 2006 | Question: 49
An implementation of a queue $Q$, using two stacks $S1$ and $S2$, is given below: void insert (Q, x) { push (S1, x); } void delete (Q) { if (stack-empty(S2)) then if (stack-empty(S1)) then { print( Q is empty ); return; } else while (!(stack-empty(S1))){ x=pop ... and $2m\leq y\leq 2n $ $ 2m\leq x<2n $ and $2m\leq y\leq n+m $ $ 2m\leq x<2n $ and $2m\leq y\leq 2n $
An implementation of a queue $Q$, using two stacks $S1$ and $S2$, is given below: void insert (Q, x) { push (S1, x); } void delete (Q) { if (stack-empty(S2)) then if (sta...
Rucha Shelke
33.1k
views
Rucha Shelke
asked
Sep 26, 2014
DS
gatecse-2006
data-structures
queue
stack
normal
+
–
45
votes
8
answers
56
GATE CSE 1998 | Question: 2.14
Let $A$ be a two dimensional array declared as follows: A: array [1 …. 10] [1 ….. 15] of integer; Assuming that each integer takes one memory location, the array is stored in row-major order and the first element of the array is stored at location $100$, what is the address of the element $A[i][j]$? $15i+j+84$ $15j+i+84$ $10i+j+89$ $10j+i+89$
Let $A$ be a two dimensional array declared as follows:A: array [1 …. 10] [1 ….. 15] of integer;Assuming that each integer takes one memory location, the array is sto...
Kathleen
29.8k
views
Kathleen
asked
Sep 25, 2014
DS
gate1998
data-structures
array
easy
+
–
22
votes
8
answers
57
GATE CSE 2005 | Question: 36
In a complete $k$-ary tree, every internal node has exactly $k$ children. The number of leaves in such a tree with $n$ internal node is: $nk$ $(n-1)k + 1$ $n(k-1) +1$ $n(k-1)$
In a complete $k$-ary tree, every internal node has exactly $k$ children. The number of leaves in such a tree with $n$ internal node is:$nk$$(n-1)k + 1$$n(k-1) +1$$n(k-1)...
Kathleen
23.1k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
tree
normal
+
–
51
votes
8
answers
58
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...
Kathleen
16.3k
views
Kathleen
asked
Sep 22, 2014
Programming in C
gatecse-2005
programming
programming-in-c
compiler-design
easy
+
–
43
votes
8
answers
59
GATE CSE 2005 | Question: 2
An Abstract Data Type (ADT) is: same as an abstract class a data type that cannot be instantiated a data type for which only the operations defined on it can be used, but none else all of the above
An Abstract Data Type (ADT) is:same as an abstract classa data type that cannot be instantiateda data type for which only the operations defined on it can be used, but no...
Kathleen
19.5k
views
Kathleen
asked
Sep 22, 2014
DS
gatecse-2005
data-structures
normal
abstract-data-type
+
–
31
votes
8
answers
60
GATE CSE 2007 | Question: 43
A complete $n-ary$ tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complete $n-ary$ tree. If $L = 41$ and $I = 10$, what is the value of $n$? $3$ $4$ $5$ $6$
A complete $n-ary$ tree is a tree in which each node has $n$ children or no children. Let $I$ be the number of internal nodes and $L$ be the number of leaves in a complet...
Kathleen
25.9k
views
Kathleen
asked
Sep 21, 2014
DS
gatecse-2007
data-structures
tree
normal
+
–
Page:
« prev
1
2
3
4
5
6
7
8
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register