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
Recent questions in Programming and DS
3
votes
2
answers
21
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
+
–
1
votes
1
answer
22
GATE CSE 2024 | Set 2 | Question: 38
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ already has $4$ elements: $100,200,300$, and $400$ ... output sequences can be generated by using the above operations? $100,200,400,300$ $200,300,400,100$ $400,200,100,300$ $300,200,400,100$
Let $\mathrm{S} 1$ and $\mathrm{S} 2$ be two stacks. $\mathrm{S} 1$ has capacity of $4$ elements. $\mathrm{S} 2$ has capacity of $2$ elements. $\text{S1}$ ...
Arjun
2.1k
views
Arjun
asked
Feb 16
DS
gatecse2024-set2
data-structures
stack
multiple-selects
+
–
3
votes
3
answers
23
GATE CSE 2024 | Set 1 | Question: 8
Consider the following $\mathrm{C}$ program: #include <stdio.h> int main() { int a=6; int b = 0; while (a<10) { a = a / 12+1 ; a += b ;} printf ("%d", a); return 0 ; } Which one of the following ... The program prints $9$ as output The program prints $10$ as output The program gets stuck in an infinite loop The program prints $6$ as output
Consider the following $\mathrm{C}$ program:#include <stdio.h int main() { int a=6; int b = 0; while (a<10) { a = a / 12+1 ; a += b ;} printf ("%d", a); return 0 ; }Whi...
Arjun
6.1k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set1
programming
programming-in-c
+
–
1
votes
3
answers
24
GATE CSE 2024 | Set 1 | Question: 9
Consider the following $\mathrm{C}$ program: #include <stdio.h> void fX (); int main(){ fX(); return 0 }; void fX () { char a; if ((a=g e t c h a r()) ! = '\n') fX(); if (a ! ... program will not terminate The program will terminate with no output The program will terminate with $4321$ as output The program will terminate with $1234$ as output
Consider the following $\mathrm{C}$ program:#include <stdio.h void fX (); int main(){ fX(); return 0 };void fX () { char a; if ((a=g e t c h a r()) ! = '\n') ...
Arjun
3.1k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set1
programming
programming-in-c
+
–
0
votes
2
answers
25
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
+
–
2
votes
2
answers
26
GATE CSE 2024 | Set 1 | Question: 38
Consider the following $\mathrm{C}$ ... the return value is less than $2^{10}$ If the inputs are $x=10, y=20$, then the return value is greater than $2^{20}$
Consider the following $\mathrm{C}$ function definition.int f (int x, int y){ for (int i=0 ; i<y ; i++ ) { x= x + x + y; } return x; }Which of the following stateme...
Arjun
2.2k
views
Arjun
asked
Feb 16
Programming in C
gatecse2024-set1
multiple-selects
programming
programming-in-c
+
–
7
votes
1
answer
27
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 16
Consider the following C code: double A[2][3] = {{1, 2, 3}, {4, 5, 6}}; Assume that A[0] = 0xFFAA0000 and the sizeof(double) is 8. What will be the value of `A[1]`? 0xFFAA0024 0xFFAA0003 0xFFAA000C 0xFFAA0018
Consider the following C code:double A [3] = {{1, 2, 3}, {4, 5, 6}};Assume that A[0] = 0xFFAA0000 and the sizeof(double) is 8.What will be the value of A ?0xFFAA00240x...
GO Classes
592
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
array
1-mark
+
–
5
votes
2
answers
28
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 27
What is a statically allocated variable in C programming? A variable allocated at an absolute address in a program’s data space A variable allocated on the stack A variable allocated on the heap A variable which can NOT be defined as local variable
What is a statically allocated variable in C programming? A variable allocated at an absolute address in a program’s data spaceA variable allocated on the stackA variab...
GO Classes
397
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
storage-classes-in-c
1-mark
+
–
7
votes
2
answers
29
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
+
–
4
votes
1
answer
30
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 34
Suppose you implement a queue using a singly linked list with head and tail pointers so that the front of the queue is at the tail of the list, and the rear of the queue is at the head of the list. What is the best possible worst-case running ... $O(n)$ for dequeue. $O(n)$ for enqueue and $O(1)$ for dequeue. $O(n)$ for both functions.
Suppose you implement a queue using a singly linked list with head and tail pointers so that the front of the queue is at the tail of the list, and the rear of the queue ...
GO Classes
400
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
data-structures
queue
linked-list
1-mark
+
–
4
votes
1
answer
31
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 42
The provided C code is a version of the C string library function strlen(), which calculates the length of a given string. unsigned int mystrlen(char *c) { unsigned int i = 0; /* Your code here. */ } Which line of code creates a working and ... != '\0') i++; return i; while (*(c + i) != '\0') ++i; return i;
The provided C code is a version of the C string library function strlen(), which calculates the length of a given string.unsigned int mystrlen(char *c) { unsigned in...
GO Classes
433
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
strings
multiple-selects
2-marks
+
–
4
votes
1
answer
32
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 43
What will be the output of the following C program? #include <stdio.h> void Mickey(int**, int, int); void Mouse(int, int*); int main() { int a = 2, b = 3, c = 4; int *points = &a; Mickey(&points, b, c); printf("%d", ... x; *p = **points+1; Mouse(z, p); return; } void Mouse(int z, int *p) { *p = *p+1; return; }
What will be the output of the following C program?#include <stdio.h>void Mickey(int , int, int);void Mouse(int, int*);int main(){ int a = 2, b = 3, c = 4; int *poi...
GO Classes
430
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
numerical-answers
programming
programming-in-c
functions
2-marks
+
–
5
votes
2
answers
33
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 44
Let $B$ be a binary search tree (BST) with eight nodes filled with the following set of eight integer keys $A=\{10,2,5,3,20,15,9,22\}$. The order in which these keys were inserted to create $B$ is not known. However ... are required to verify if all eight keys of $A$ are present in $B$. How many leaf nodes are present in B?
Let $B$ be a binary search tree (BST) with eight nodes filled with the following set of eight integer keys $A=\{10,2,5,3,20,15,9,22\}$. The order in which these keys were...
GO Classes
511
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
numerical-answers
data-structures
binary-search-tree
2-marks
+
–
7
votes
1
answer
34
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 45
Consider a stack whose elements are unsigned integers and support the following operations: PUSH a: Pushes the element 'a' onto the stack. ADD: Adds the two topmost elements, removes them, and pushes the result. SQR: ... once, count it as many times as it is used. Your final count should include initial 3 PUSH instructions.
Consider a stack whose elements are unsigned integers and support the following operations:PUSH a: Pushes the element 'a' onto the stack.ADD: Adds the two topmost element...
GO Classes
554
views
GO Classes
asked
Feb 5
DS
goclasses2024-mockgate-14
numerical-answers
data-structures
stack
2-marks
+
–
4
votes
1
answer
35
GO Classes Test Series 2024 | Mock GATE | Test 14 | Question: 54
Consider the following pseudocode procedure. Which of the following best describes procedure mystery? It returns a list of numbers from 1 to $n$. It prints every third number from 1 to $n$. It returns the sum of the numbers from 1 to $\mathrm{n}$. It returns the sum of the multiples of 3 from 1 to $n$.
Consider the following pseudocode procedure.Which of the following best describes procedure mystery?It returns a list of numbers from 1 to $n$.It prints every third numbe...
GO Classes
252
views
GO Classes
asked
Feb 5
Programming in C
goclasses2024-mockgate-14
programming
programming-in-c
functions
2-marks
+
–
0
votes
0
answers
36
Memory Based GATE DA 2024 | Question: 20
Consider the following Python code: S[1] = [1] x = [6, 3, 5, 4, 10] for i in range(2, len(x)): S[i] = [1] if x[i - 1]
Consider the following Python code:S = x = [6, 3, 5, 4, 10]for i in range(2, len(x)): S[i] = if x[i - 1]
GO Classes
118
views
GO Classes
asked
Feb 4
Programming
gate2024-da-memory-based
goclasses
programming
programming-in-python
+
–
0
votes
0
answers
37
Memory Based GATE DA 2024 | Question: 21
What does the following Python code do? \begin{verbatim} def fun(D, S_1, S_2): if S_1 < S_2: D[S_1], D[S_2] = D[S_2], D[S_1] fun(D, S_1 + 1, S_2 - 1) \end{verbatim}
What does the following Python code do?\begin{verbatim}def fun(D, S_1, S_2): if S_1 < S_2: D[S_1], D[S_2] = D[S_2], D[S_1] fun(D, S_1...
GO Classes
105
views
GO Classes
asked
Feb 4
Programming
gate2024-da-memory-based
goclasses
programming
programming-in-python
+
–
2
votes
2
answers
38
Memory Based GATE DA 2024 | Question: 23
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree? Inorder + Preorder Preorder + Postorder Only Inorder Inorder + Postorder
Consider a binary tree. Among the following traversal combinations, which of them can uniquely construct the tree?Inorder + PreorderPreorder + PostorderOnly InorderInorde...
GO Classes
347
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
binary-tree
tree-traversal
+
–
0
votes
1
answer
39
Memory Based GATE DA 2024 | Question: 24
Consider a doubly linked list with the following operations: - Insert First (\texttt{InsertFirst}) \\ - Insert Last (\texttt{InsertLast}) \\ - Remove First (\texttt{RemoveFirst}) \\ - Remove Last (\texttt{RemoveLast}) The following operations are ... \ & a = \text{RemoveLast} \end{aligned} \] What is the value of \(a\) after these operations?
Consider a doubly linked list with the following operations:- Insert First (\texttt{InsertFirst})\\- Insert Last (\texttt{InsertLast})\\- Remove First (\texttt{RemoveFirs...
GO Classes
223
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
linked-list
numerical-answers
+
–
0
votes
1
answer
40
Memory Based GATE DA 2024 | Question: 40
Match the following: $ \begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|} \hline \textbf{Technique} & \textbf{Characteristic} \\ \hline FIFO & (ii) Queue \\ \hline Look Up & (i) Hash Table\\ \hline LIFO & (iii) Stack \\ \hline \end{array} $
Match the following:$$\begin{array}{|p{0.3\linewidth}|p{0.6\linewidth}|} \hline \textbf{Technique} & \textbf{Characteristic} \\ \hline FIFO & ...
GO Classes
195
views
GO Classes
asked
Feb 4
DS
gate2024-da-memory-based
goclasses
data-structures
stack
+
–
Page:
« prev
1
2
3
4
5
6
7
...
310
next »
Email or Username
Show
Hide
Password
I forgot my password
Remember
Log in
Register