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
41
votes
4
answers
121
GATE CSE 2015 Set 3 | Question: 54
Consider the following C program: #include<stdio.h> int f1(void); int f2(void); int f3(void); int x=10; int main() { int x=1; x += f1() + f2 () + f3() + f2(); printf("%d", x); return 0; } int f1() { int x = 25; x++; return x;} int f2() { static int x = 50; x++; return x;} int f3() { x *= 10; return x;} The output of the program is ______.
go_editor
asked
in
Programming in C
Feb 16, 2015
by
go_editor
11.8k
views
gatecse-2015-set3
programming
programming-in-c
normal
numerical-answers
77
votes
1
answer
122
GATE CSE 2015 Set 3 | Question: 48
Consider the following C program: #include<stdio.h> int main() { int i, j, k = 0; j=2 * 3 / 4 + 2.0 / 5 + 8 / 5; k-=--j; for (i=0; i<5; i++) { switch(i+k) { case 1: case 2: printf("\n%d", i+k); ... : printf("\n%d", i+k); default: printf("\n%d", i+k); } } return 0; } The number of times printf statement is executed is _______.
go_editor
asked
in
Programming in C
Feb 16, 2015
by
go_editor
22.3k
views
gatecse-2015-set3
programming
programming-in-c
switch-case
normal
numerical-answers
43
votes
3
answers
123
GATE CSE 2015 Set 3 | Question: 30
Consider the following two C code segments. $Y$ and $X$ are one and two dimensional arrays of size $n$ and $ n \times n$ respectively, where $2 \leq n \leq 10$. Assume that in both code segments, elements of $Y$ are initialized to $0$ ... $2$ are contiguous in main memory Only S2 is correct Only S3 is correct Only S1 and S2 are correct Only S1 and S3 are correct
go_editor
asked
in
Programming in C
Feb 15, 2015
by
go_editor
8.8k
views
gatecse-2015-set3
programming-in-c
normal
array
61
votes
11
answers
124
GATE CSE 2015 Set 3 | Question: 26
Consider the following C program #include<stdio.h> int main() { static int a[] = {10, 20, 30, 40, 50}; static int *p[] = {a, a+3, a+4, a+1, a+2}; int **ptr = p; ptr++; printf("%d%d", ptr-p, **ptr); } The output of the program is _______.
go_editor
asked
in
Programming in C
Feb 15, 2015
by
go_editor
22.4k
views
gatecse-2015-set3
programming
programming-in-c
normal
numerical-answers
pointers
42
votes
12
answers
125
GATE CSE 2015 Set 3 | Question: 25
Consider a binary tree T that has $200$ leaf nodes. Then the number of nodes in T that have exactly two children are ______.
go_editor
asked
in
DS
Feb 14, 2015
by
go_editor
23.9k
views
gatecse-2015-set3
data-structures
binary-tree
normal
numerical-answers
32
votes
4
answers
126
GATE CSE 2015 Set 3 | Question: 19
Consider the following array of elements. $\langle 89, 19, 50, 17, 12, 15, 2, 5, 7, 11, 6, 9, 100 \rangle$ The minimum number of interchanges needed to convert it into a max-heap is $4$ $5$ $2$ $3$
go_editor
asked
in
DS
Feb 14, 2015
by
go_editor
9.0k
views
gatecse-2015-set3
data-structures
heap
easy
36
votes
4
answers
127
GATE CSE 2015 Set 3 | Question: 17
Given that hash table $T$ with $25$ slots that stores $2000$ elements, the load factor $a$ for $T$ is _________.
go_editor
asked
in
DS
Feb 14, 2015
by
go_editor
9.2k
views
gatecse-2015-set3
data-structures
hashing
easy
numerical-answers
25
votes
8
answers
128
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$
go_editor
asked
in
DS
Feb 14, 2015
by
go_editor
7.3k
views
gatecse-2015-set3
data-structures
binary-search-tree
easy
27
votes
6
answers
129
GATE CSE 2015 Set 3 | Question: 12
The result evaluating the postfix expression $10 \ 5 + 60 \ 6 / * 8 -$ is $284$ $213$ $142$ $71$
go_editor
asked
in
DS
Feb 14, 2015
by
go_editor
12.9k
views
gatecse-2015-set3
data-structures
stack
normal
46
votes
8
answers
130
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$
go_editor
asked
in
Programming in C
Feb 14, 2015
by
go_editor
16.0k
views
gatecse-2015-set3
programming
programming-in-c
normal
array
110
votes
6
answers
131
GATE CSE 2015 Set 1 | Question: 35
What is the output of the following C code? Assume that the address of $x$ is $2000$ (in decimal) and an integer requires four bytes of memory. int main () { unsigned int x [4] [3] = {{1, 2, 3}, {4, 5, 6}, {7, 8, 9}, {10, 11, 12}}; printf ("%u, %u, %u", x + 3, *(x + 3), *(x + 2) + 3); } $2036, 2036, 2036$ $2012, 4, 2204$ $2036, 10, 10$ $2012, 4, 6$
makhdoom ghaya
asked
in
Programming in C
Feb 13, 2015
by
makhdoom ghaya
27.9k
views
gatecse-2015-set1
programming
programming-in-c
array
normal
54
votes
7
answers
132
GATE CSE 2015 Set 1 | Question: 33
Consider the following pseudo code, where $x$ and $y$ are positive integers. begin q := 0 r := x while r ≥ y do begin r := r - y q := q + 1 end end The post condition that needs to be satisfied after the program terminates is $\{ r = qx + y \wedge r < y\}$ ... $\{ y = qx + r \wedge 0 < r < y\}$ $\{ q + 1 < r - y \wedge y > 0\}$
makhdoom ghaya
asked
in
Programming in C
Feb 13, 2015
by
makhdoom ghaya
15.5k
views
gatecse-2015-set1
programming
loop-invariants
normal
28
votes
1
answer
133
GATE CSE 2015 Set 1 | Question: 32
Consider a max heap, represented by the array: $40, 30, 20, 10, 15, 16, 17, 8, 4$ ... $40, 30, 20, 10, 35, 16, 17, 8, 4, 15$ $40, 35, 20, 10, 15, 16, 17, 8, 4, 30$
makhdoom ghaya
asked
in
DS
Feb 13, 2015
by
makhdoom ghaya
6.9k
views
gatecse-2015-set1
data-structures
binary-heap
easy
23
votes
4
answers
134
GATE CSE 2015 Set 1 | Question: 25
The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree of height $5$ are $63$ and $6$, respectively $64$ and $5$, respectively $32$ and $6$, respectively $31$ and $5$, respectively
makhdoom ghaya
asked
in
DS
Feb 13, 2015
by
makhdoom ghaya
10.9k
views
gatecse-2015-set1
data-structures
binary-tree
easy
47
votes
3
answers
135
GATE CSE 2015 Set 1 | Question: 23
What are the worst-case complexities of insertion and deletion of a key in a binary search tree? $\Theta(\log n)$ for both insertion and deletion $\Theta(n)$ for both insertion and deletion $\Theta(n)$ for insertion and $\Theta(\log n)$ for deletion $\Theta(\log n)$ for insertion and $\Theta(n)$ for deletion
makhdoom ghaya
asked
in
DS
Feb 13, 2015
by
makhdoom ghaya
10.3k
views
gatecse-2015-set1
data-structures
binary-search-tree
easy
35
votes
5
answers
136
GATE CSE 2015 Set 1 | Question: 11
The output of the following C program is_____________. void f1 ( int a, int b) { int c; c = a; a = b; b = c; } void f2 ( int * a, int * b) { int c; c = * a; *a = *b; *b = c; } int main () { int a = 4, b = 5, c = 6; f1 ( a, b); f2 (&b, &c); printf ("%d", c - a - b); }
makhdoom ghaya
asked
in
Programming in C
Feb 12, 2015
by
makhdoom ghaya
11.9k
views
gatecse-2015-set1
programming
programming-in-c
easy
numerical-answers
35
votes
4
answers
137
GATE CSE 2015 Set 2 | Question: 38
Consider the C program below #include <stdio.h> int *A, stkTop; int stkFunc (int opcode, int val) { static int size=0, stkTop=0; switch (opcode) { case -1: size = val; break; case 0: if (stkTop < size ) A[stkTop++]=val; break; default ... 0, 10); printf ("%d\n", stkFunc(1, 0)+ stkFunc(1, 0)); } The value printed by the above program is ________.
go_editor
asked
in
DS
Feb 12, 2015
by
go_editor
10.6k
views
gatecse-2015-set2
data-structures
stack
easy
numerical-answers
72
votes
4
answers
138
GATE CSE 2015 Set 2 | Question: 33
Which one of the following hash functions on integers will distribute keys most uniformly over $10$ buckets numbered $0$ to $9$ for $i$ ranging from $0$ to $2020$? $h(i) = i^2 \text{mod } 10$ $h(i) = i^3 \text{mod } 10$ $h(i) = (11 \ast i^2) \text{mod } 10$ $h(i) = (12 \ast i^2) \text{mod } 10$
go_editor
asked
in
DS
Feb 12, 2015
by
go_editor
16.9k
views
gatecse-2015-set2
data-structures
hashing
normal
71
votes
9
answers
139
GATE CSE 2015 Set 2 | Question: 31
A Young tableau is a $2D$ array of integers increasing from left to right and from top to bottom. Any unfilled entries are marked with $\infty$, and hence there cannot be any entry to the right of, or below a $\infty$. The following Young tableau ... The minimum number of entries (other than $1$) to be shifted, to remove $1$ from the given Young tableau is _____.
go_editor
asked
in
DS
Feb 12, 2015
by
go_editor
13.1k
views
gatecse-2015-set2
databases
array
normal
numerical-answers
25
votes
3
answers
140
GATE CSE 2015 Set 1 | Question: 10
Which of the following is/are correct in order traversal sequence(s) of binary search tree(s)? $3, 5, 7, 8, 15, 19, 25$ $5, 8, 9, 12, 10, 15, 25$ $2, 7, 10, 8, 14, 16, 20$ $4, 6, 7, 9, 18, 20, 25$ I and IV only II and III only II and IV only II only
makhdoom ghaya
asked
in
DS
Feb 12, 2015
by
makhdoom ghaya
7.3k
views
gatecse-2015-set1
data-structures
binary-search-tree
easy
Page:
« prev
1
2
3
4
5
6
7
8
9
10
11
12
...
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