Login
Register
@
Dark Mode
Profile
Edit my Profile
Messages
My favorites
Register
Activity
Q&A
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous Years
Blogs
New Blog
Exams
Dark Mode
Webpage
Programming in C.
Recursion.
Filter
Recent
Hot!
Most votes
Most answers
Most views
Previous GATE
Featured
Previous GATE Questions in Programming and DS
3
votes
2
answers
1
GATE CSE 2024 | Set 2 | Question: 3
Consider the following $\text{C}$ program. Assume parameters to a function are evaluated from right to left. #include <stdio.h> int g( int p) { printf("%d", p); return p; } int h(i nt q) { printf("%d", q) ... one of the following options is the CORRECT output of the above $\text{C}$ program? $20101020$ $10202010$ $20102010$ $10201020$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
3.2k
views
gatecse2024-set2
programming
programming-in-c
3
votes
1
answer
2
GATE CSE 2024 | Set 2 | Question: 23
Consider the following $\mathrm{C}$ function definition. int f X(char * a) { char * b = a; while (*b) b ++; return b - a; } Which of the following statements is/are TRUE? The function call $\text{f X("a b c d''}$) will ... ${ }^{*} \mathrm{C}=$ "abcd" in main (), the function call $\mathrm{fX}(\mathrm{c})$ will always return a value
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
2.1k
views
gatecse2024-set2
programming
programming-in-c
multiple-selects
2
votes
2
answers
3
GATE CSE 2024 | Set 2 | Question: 26
What is the output of the following $\text{C}$ program? #include <stdio.h> int main() { double $a[2]=\{20.0,25.0\},{ }^{*} \mathrm{p},{ }^{*} \mathrm{q}$; $\mathrm{p}=\mathrm{a} ;$ $q=p+1 ;$ printf("%d,%d", (int) $(q-p),($ int $\left.)\left({ }^{*} q-{ }^{*} p\right)\right)$; return $0$ ; } $4,8$ $1,5$ $8,5$ $1,8$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
2.5k
views
gatecse2024-set2
programming
programming-in-c
3
votes
2
answers
4
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$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
1.7k
views
gatecse2024-set2
programming
programming-in-c
1
vote
1
answer
5
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$
Arjun
asked
in
DS
Feb 16
by
Arjun
1.7k
views
gatecse2024-set2
data-structures
stack
multiple-selects
3
votes
3
answers
6
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
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
5.5k
views
gatecse2024-set1
programming
programming-in-c
1
vote
3
answers
7
GATE CSE 2024 | Set 1 | Question: 9
Consider the following $\mathrm{C}$ program: #include <stdio.h> void fX () { void fX () ; char a; int main() { if ((a=g e t c h a r()) ! = '\n') fX}() ; fX(); return 0 ; 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
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
2.6k
views
gatecse2024-set1
programming
programming-in-c
0
votes
2
answers
8
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$
Arjun
asked
in
DS
Feb 16
by
Arjun
1.9k
views
gatecse2024-set1
data-structures
2
votes
1
answer
9
GATE CSE 2024 | Set 1 | Question: 38
Consider the following $\mathrm{C}$ function definition. int $\mathrm{f}$ (int $\mathrm{x}$, int $\mathrm{y})$ { for (int $i=0 ; i<y ; i++$ ) { $\mathrm{x}=\mathrm{x}+\mathrm{x}+\mathrm{y}$; } return $\mathrm{x}$; } Which of the ... $2^{10}$ If the inputs are $x=10, y=20$, then the return value is greater than $2^{20}$
Arjun
asked
in
Programming in C
Feb 16
by
Arjun
1.9k
views
gatecse2024-set1
multiple-selects
programming
programming-in-c
14
votes
3
answers
10
GATE CSE 2023 | Question: 2
Which one of the following sequences when stored in an array at locations $A[1], \ldots, A[10]$ forms a max-heap? $23,17,10,6,13,14,1,5,7,12$ $23,17,14,7,13,10,1,5,6,12$ $23,17,14,6,13,10,1,5,7,15$ $23,14,17,1,10,13,16,12,7,5$
admin
asked
in
DS
Feb 15, 2023
by
admin
6.5k
views
gatecse-2023
data-structures
binary-heap
1-mark
8
votes
2
answers
11
GATE CSE 2023 | Question: 3
Let $\textsf{SLLdel}$ be a function that deletes a node in a singly-linked list given a pointer to the node and a pointer to the head of the list. Similarly, let $\textsf{DLLdel}$ be another function that deletes a node in a doubly-linked list given a pointer to the node ... $\textsf{DLLdel}$ are $O(1)$ $\textsf{SLLdel}$ is $O(n)$ and $\textsf{DLLdel}$ is $O(1)$
admin
asked
in
DS
Feb 15, 2023
by
admin
10.3k
views
gatecse-2023
data-structures
linked-list
1-mark
18
votes
3
answers
12
GATE CSE 2023 | Question: 25
The integer value printed by the $\textsf{ANSI-C}$ program given below is _______________ #include<stdio.h> int funcp(){ static int x = 1; x++; return x; } int main(){ int x,y; x = funcp(); y = funcp()+x; printf("%d\n", (x+y)); return 0; }
admin
asked
in
Programming in C
Feb 15, 2023
by
admin
10.6k
views
gatecse-2023
programming
programming-in-c
output
numerical-answers
1-mark
7
votes
3
answers
13
GATE CSE 2023 | Question: 36
Let $A$ be a priority queue for maintaining a set of elements. Suppose $A$ is implemented using a max-heap data structure. The operation $\text{EXTRACT-MAX} (A)$ extracts and deletes the maximum element from $A$. The operation $\operatorname{INSERT}(A, key )$ inserts a new ... $O(1)$ whereas $\operatorname{INSERT}(A, k e y)$ runs in $O(\log (n))$.
admin
asked
in
DS
Feb 15, 2023
by
admin
6.1k
views
gatecse-2023
data-structures
priority-queue
time-complexity
heap
2-marks
8
votes
2
answers
14
GATE CSE 2023 | Question: 37
Consider the $\text{C}$ function $\text{foo}$ and the binary tree shown. typedef struct node { int val; struct node *left, *right; } node; int foo(node *p) { int retval; if (p == NULL) return 0; else { retval = p->val + foo(p->left) + foo(p->right); printf("%d ", ... $3 \;5\; 8\; 10\; 11\; 13$ $3 \;8 \;16 \;13\; 24\; 50$ $3\; 16\; 8\; 50\; 24\; 13$
admin
asked
in
DS
Feb 15, 2023
by
admin
6.6k
views
gatecse-2023
data-structures
binary-tree
2-marks
6
votes
3
answers
15
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 ______________.
admin
asked
in
DS
Feb 15, 2023
by
admin
6.5k
views
gatecse-2023
data-structures
stack
numerical-answers
2-marks
easy
2
votes
1
answer
16
GATE CSE 2023 | Memory Based Question: 41
Which one of the following sequences when stored in an array at locations A[1],...,A[10] forms a max-heap? $23\; 17\; 10\; 6\; 13\; 14\; 1\; 5 \;9 \;12$ $23 \;14 \;19 \;1 \;10 \;13 \;16 \;12 \;7 \;5$ $23 \;17\; 14\; 6\; 13\; 10\; 1\; 5\; 7\; 15$ $23 \;17\; 14\; 7\; 13\; 10\; 1\; 5\; 6\; 12$
closed
GO Classes
asked
in
DS
Feb 5, 2023
by
GO Classes
4.8k
views
memorybased-gatecse2023
goclasses
data-structures
binary-heap
5
votes
2
answers
17
GATE CSE 2014 Set 2 | Question: 10 | Modified
Consider the function func shown below: int func(int num) { int count = 0; while (num) { count++; num>>= 1; } return (count); } The value returned by func(-435) is: 6 9 Will loop forever Depends on computer architecture
Souvik33
asked
in
Programming in C
Jan 15, 2023
by
Souvik33
1.1k
views
algorithms
identify-function
numerical-answers
easy
19
votes
4
answers
18
GATE CSE 2022 | Question: 5
Consider the problem of reversing a singly linked list. To take an example, given the linked list below, the reversed linked list should look like Which one of the following statements is $\text{TRUE}$ about the time complexity of algorithms that solve the above problem ... $O(1)$ space.
Arjun
asked
in
DS
Feb 15, 2022
by
Arjun
9.0k
views
gatecse-2022
data-structures
linked-list
1-mark
11
votes
3
answers
19
GATE CSE 2022 | Question: 11
What is printed by the following $\text{ANSI C}$ program? #include<stdio.h> int main(int argc, char *argv[]) { int x = 1, z[2] = {10, 11}; int *p = NULL; p = &x; *p = 10; p = &z[1]; *(&z[0] + 1) += 3; printf(“%d, %d, %d\n”, x, z[0], z[1]); return 0; } $1, 10, 11$ $1, 10, 14$ $10, 14, 11$ $10, 10, 14$
Arjun
asked
in
Programming in C
Feb 15, 2022
by
Arjun
5.7k
views
gatecse-2022
programming
programming-in-c
pointers
output
1-mark
40
votes
3
answers
20
GATE CSE 2022 | Question: 18
Suppose a binary search tree with $1000$ distinct elements is also a complete binary tree. The tree is stored using the array representation of binary heap trees. Assuming that the array indices start with $0,$ the $3^{\text{rd}}$ largest element of the tree is stored at index ______________ .
Arjun
asked
in
DS
Feb 15, 2022
by
Arjun
14.8k
views
gatecse-2022
numerical-answers
data-structures
binary-search-tree
1-mark
Page:
1
2
3
4
5
6
...
16
next »
Subscribe to GATE CSE 2024 Test Series
Subscribe to GO Classes for GATE CSE 2024
Quick search syntax
tags
tag:apple
author
user:martin
title
title:apple
content
content:apple
exclude
-tag:apple
force match
+apple
views
views:100
score
score:10
answers
answers:2
is accepted
isaccepted:true
is closed
isclosed:true
Recent Posts
Post GATE 2024 Guidance [Counseling tips and resources]
GATE CSE 2024 Result Responses
[Project Contest] Pytorch backend support for MLCommons Cpp Inference implementation
Participating in MLCommons Inference v4.0 submission (deadline is February 23 12pm IST)
IIITH PGEE 2024 Test Series by GO Classes
Subjects
All categories
General Aptitude
(3.5k)
Engineering Mathematics
(10.4k)
Digital Logic
(3.6k)
Programming and DS
(6.2k)
Programming
(4.1k)
DS
(2.0k)
Algorithms
(4.8k)
Theory of Computation
(6.9k)
Compiler Design
(2.5k)
Operating System
(5.2k)
Databases
(4.8k)
CO and Architecture
(4.0k)
Computer Networks
(4.9k)
Artificial Intelligence
(79)
Machine Learning
(48)
Data Mining and Warehousing
(25)
Non GATE
(1.4k)
Others
(2.7k)
Admissions
(684)
Exam Queries
(1.6k)
Tier 1 Placement Questions
(17)
Job Queries
(80)
Projects
(11)
Unknown Category
(870)
64.3k
questions
77.9k
answers
244k
comments
80.0k
users
Previous GATE Questions in Programming and DS
Recent Blog Comments
category ?
Hi @Arjun sir, I have obtained a score of 591 in ...
download here
Can you please tell about IIT-H mtech CSE self...
Please add your admission queries here:...
Network Sites
GO Mechanical
GO Electrical
GO Electronics
GO Civil
CSE Doubts
Aptitude Overflow