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
Hot questions in Programming and DS
62
votes
5
answers
151
GATE CSE 2014 Set 1 | Question: 10
Consider the following program in C language: #include <stdio.h> main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); } Which one of the following statements is TRUE? Compilation fails. Execution ... $5$ more than the address of variable $i$. On execution, the value printed is $5$ more than the integer value entered.
Consider the following program in C language:#include <stdio.h main() { int i; int*pi = &i; scanf("%d",pi); printf("%d\n", i+5); }Which one of the following statements is...
go_editor
17.5k
views
go_editor
asked
Sep 26, 2014
Programming in C
gatecse-2014-set1
programming
programming-in-c
easy
pointers
+
–
3
votes
2
answers
152
GATE CSE 2024 | Set 2 | Question: 32
Consider an array $\mathrm{X}$ that contains $\mathrm{n}$ positive integers. A subarray of $\mathrm{X}$ is defined to be a sequence of array locations with consecutive indices. The $\mathrm{C}$ code snippet given below has been written to compute the length of the longest ... $\text{(P) } \text{len} 2+1$ $\text{(Q) } \text{len} 1+1$
Consider an array $\mathrm{X}$ that contains $\mathrm{n}$ positive integers. A subarray of $\mathrm{X}$ is defined to be a sequence of array locations with co...
Arjun
2.0k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set2
programming
programming-in-c
+
–
6
votes
3
answers
153
GATE CSE 2023 | Question: 49
Consider a sequence $a$ of elements $a_{0}=1, a_{1}=5, a_{2}=7, a_{3}=8, a_{4}=9$, and $a_{5}=2$. The following operations are performed on a stack $S$ and a queue $Q,$ both of which are initially empty. $\textsf{push}$ the ... $S$. $\textsf{pop}$ an element from $S$. The top element of $S$ after executing the above operations is ______________.
Consider a sequence $a$ of elements $a_{0}=1, a_{1}=5, a_{2}=7, a_{3}=8, a_{4}=9$, and $a_{5}=2$. The following operations are performed on a stack $S$ and a queue $Q,$ b...
admin
6.9k
views
admin
asked
Feb 15, 2023
DS
gatecse-2023
data-structures
stack
numerical-answers
2-marks
easy
+
–
9
votes
3
answers
154
ISRO2011-62
The average depth of a binary search tree is $O(n^{0.5})$ $O(n)$ $O(\log n)$ $O(n \log n)$
The average depth of a binary search tree is$O(n^{0.5})$$O(n)$$O(\log n)$$O(n \log n)$
go_editor
21.5k
views
go_editor
asked
Jun 23, 2016
DS
isro2011
data-structures
binary-search-tree
time-complexity
+
–
5
votes
3
answers
155
ISRO2016-30
A complete binary tree with $n$ non-leaf nodes contains $\log_{2}n$ nodes $n+1$ nodes $2n$ nodes $2n+1$ nodes
A complete binary tree with $n$ non-leaf nodes contains$\log_{2}n$ nodes$n+1$ nodes$2n$ nodes$2n+1$ nodes
ManojK
9.2k
views
ManojK
asked
Jul 4, 2016
DS
data-structures
binary-tree
isro2016
+
–
55
votes
8
answers
156
GATE CSE 2000 | Question: 1.2
An $n \times n$ array $v$ is defined as follows: $v\left[i,j\right] = i - j$ for all $i, j, i \leq n, 1 \leq j \leq n$ The sum of the elements of the array $v$ is $0$ $n-1$ $n^2 - 3n +2$ $n^2 \frac{\left(n+1\right)}{2}$
An $n \times n$ array $v$ is defined as follows:$v\left[i,j\right] = i - j$ for all $i, j, i \leq n, 1 \leq j \leq n$The sum of the elements of the array $v$ is$0$$n-1$$n...
Kathleen
10.0k
views
Kathleen
asked
Sep 14, 2014
DS
gatecse-2000
data-structures
array
easy
+
–
7
votes
4
answers
157
number of ordered trees
The number of possible ordered trees with 3 nodes A, B, C is: (a) 16 (b) 12 (c) 6 (d) 10 what is ordered tree alignment?
The number of possible ordered trees with 3 nodes A, B, C is:(a) 16 (b) 12 (c) 6 (d) 10 what is ordered tree alignment?
padmaja
19.2k
views
padmaja
asked
May 28, 2016
DS
tree
+
–
45
votes
4
answers
158
GATE CSE 2012 | Question: 48
Consider the following C code segment. int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf( \n %d %d , a, b); } void prtFun(void) { static int a = 2; /* Line 2 */ int b = 1; a += + ... $\begin{array}{lll} 3 & & 1 & \\ 5 & & 2 & \\ 5 & & 2 & \end{array}$
Consider the following C code segment.int a, b, c = 0; void prtFun(void); main() { static int a = 1; /* Line 1 */ prtFun(); a += 1; prtFun(); printf(“ \n %d %d ”, a, ...
gatecse
13.9k
views
gatecse
asked
Sep 29, 2014
Programming in C
gatecse-2012
programming
programming-in-c
normal
+
–
40
votes
5
answers
159
GATE CSE 2012 | Question: 3
What will be the output of the following C program segment? char inChar = 'A'; switch ( inChar ) { case 'A' : printf ("Choice A \ n"); case 'B' : case 'C' : printf ("Choice B"); case ... : printf ("No Choice"); } No Choice Choice A Choice A Choice B No Choice Program gives no output as it is erroneous
What will be the output of the following C program segment?char inChar = 'A'; switch ( inChar ) { case 'A' : printf ("Choice A \ n"); case 'B' : case 'C' : printf ("Choic...
gatecse
11.0k
views
gatecse
asked
Aug 5, 2014
Programming in C
gatecse-2012
programming
easy
programming-in-c
switch-case
+
–
24
votes
2
answers
160
GATE CSE 2006 | Question: 77
Statement for Linked Answer Questions 76 & 77: A $3$-ary max heap is like a binary max heap, but instead of $2$ children, nodes have $3$ children. A $3$-ary heap can be represented by an array as follows: The root is stored in the first location, $a[0]$, nodes in the next level, from left to ... $10, 9, 4, 5, 7, 6, 8, 2, 1, 3$ $10, 8, 6, 9, 7, 2, 3, 4, 1, 5$
Statement for Linked Answer Questions 76 & 77:A $3$-ary max heap is like a binary max heap, but instead of $2$ children, nodes have $3$ children. A $3$-ary heap can be re...
Arjun
7.5k
views
Arjun
asked
Nov 27, 2016
DS
gatecse-2006
data-structures
binary-heap
normal
+
–
65
votes
4
answers
161
GATE CSE 2003 | Question: 63, ISRO2009-25
A data structure is required for storing a set of integers such that each of the following operations can be done in $O(\log n)$ time, where $n$ is the number of elements in the set. Deletion of the smallest element Insertion of an ... used but not a heap Both balanced binary search tree and heap can be used Neither balanced search tree nor heap can be used
A data structure is required for storing a set of integers such that each of the following operations can be done in $O(\log n)$ time, where $n$ is the number of elements...
Kathleen
20.3k
views
Kathleen
asked
Sep 17, 2014
DS
gatecse-2003
data-structures
easy
isro2009
binary-search-tree
+
–
33
votes
8
answers
162
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...
Kathleen
10.3k
views
Kathleen
asked
Sep 12, 2014
Programming in C
gate1991
programming
recursion
normal
numerical-answers
+
–
6
votes
6
answers
163
ISRO2020-18
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The array is stored in row-major format. If the first element $x[0][0]$ occupies the memory location ... , which all locations (in decimal) will be holding a value of $10$? $1018,1019$ $1022,1041$ $1013,1014$ $1000,1399$
Consider a $2$-dimensional array $x$ with $10$ rows and $4$ columns, with each element storing a value equivalent to the product of row number and column number. The arra...
Satbir
9.8k
views
Satbir
asked
Jan 13, 2020
Programming in C
isro-2020
programming
array
normal
+
–
0
votes
2
answers
164
GATE CSE 2024 | Set 1 | Question: 33
Consider a binary min-heap containing $105$ distinct elements. Let $k$ be the index (in the underlying array) of the maximum element stored in the heap. The number of possible values of $k$ is $53$ $52$ $27$ $1$
Consider a binary min-heap containing $105$ distinct elements. Let $k$ be the index (in the underlying array) of the maximum element stored in the heap. The number of pos...
Arjun
2.4k
views
Arjun
asked
Feb 16
DS
gatecse2024-set1
data-structures
+
–
23
votes
4
answers
165
GATE IT 2008 | Question: 50
Consider the C program below. What does it print? # include <stdio.h> # define swapl (a, b) tmp = a; a = b; b = tmp void swap2 ( int a, int b) { int tmp; tmp = a; a = b; b = tmp; } void swap3 (int*a, int*b) { int tmp; tmp = *a; *a = *b; *b ... (num1 > = num2) {swap3 (&num1, &num2);} printf ("%d, %d", num1, num2); } $5, 5$ $5, 4$ $4, 5$ $4, 4$
Consider the C program below. What does it print?# include <stdio.h # define swapl (a, b) tmp = a; a = b; b = tmp void swap2 ( int a, int b) { int tmp; tmp = a; a = b; b ...
Ishrat Jahan
10.6k
views
Ishrat Jahan
asked
Oct 28, 2014
Programming in C
gateit-2008
programming
programming-in-c
easy
parameter-passing
+
–
19
votes
3
answers
166
GATE CSE 2021 Set 1 | Question: 10
A binary search tree $T$ contains $n$ distinct elements. What is the time complexity of picking an element in $T$ that is smaller than the maximum element in $T$? $\Theta(n\log n)$ $\Theta(n)$ $\Theta(\log n)$ $\Theta (1)$
A binary search tree $T$ contains $n$ distinct elements. What is the time complexity of picking an element in $T$ that is smaller than the maximum element in $T$?$\Theta(...
Arjun
11.8k
views
Arjun
asked
Feb 18, 2021
DS
gatecse-2021-set1
data-structures
binary-search-tree
time-complexity
1-mark
+
–
1
votes
1
answer
167
GATE DS&AI 2024 | Question: 11
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table with $m$ slots. The expected number of probes in an unsuccessful search is at most $\frac{1}{1-\alpha}$. Inserting ... $\frac{1}{1-\alpha}$ $1+\frac{\alpha}{2}$ $\frac{1}{1+\alpha}$
Consider performing uniform hashing on an open address hash table with load factor $\alpha=\frac{n}{m}<1$, where $n$ elements are stored in the table wi...
Arjun
819
views
Arjun
asked
Feb 16
DS
gate-ds-ai-2024
data-structures
hashing
uniform-hashing
+
–
7
votes
2
answers
168
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 33
On a $64$-bit system, which of the following C expressions is equivalent to the C expression $(x[2]+4)[3]?$ Assume $\mathrm{x}$ is declared as $\textsf{int}\ast \ast \textsf{x}$ $\ast((*(x+16))+28)$ $\ast((*(x+2))+7)$ $\ast(((* x)+2)+7)$ $(* \ast(x+2)+7)$
On a $64$-bit system, which of the following C expressions is equivalent to the C expression $(x +4)[3]?$ Assume $\mathrm{x}$ is declared as $\textsf{int}\ast \ast \text...
GO Classes
454
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
pointers
1-mark
+
–
7
votes
3
answers
169
GO Classes Test Series 2024 | Mock GATE | Test 13 | Question: 40
You are given a complete binary tree (each level must be full except the last) on $n$ vertices. Each vertex $v$ is labeled by an integer value $x_v$. Say that a vertex is a local minimum if its label is less than the labels of each of its ... minimum in the tree? $\theta(n)$ $\theta(\sqrt{n})$ $\theta(\log n)$ $\theta(n \log n)$
You are given a complete binary tree (each level must be full except the last) on $n$ vertices. Each vertex $v$ is labeled by an integer value $x_v$. Say that a vertex is...
GO Classes
803
views
GO Classes
asked
Jan 28
DS
goclasses2024-mockgate-13
goclasses
data-structures
binary-tree
time-complexity
2-marks
+
–
1
votes
0
answers
170
Arrays
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element present at location arr[–6][4] is- ____________.
Consider an integer upper triangular 2D array arr[–8 to +7][–8 to +7] having base address 1000. If the size of the integer is 4 bytes, the address of the element pres...
piyush512
67
views
piyush512
asked
5 days
ago
DS
array
data-structures
+
–
Page:
« prev
1
...
3
4
5
6
7
8
9
10
11
12
13
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register