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
27
votes
5
answers
61
GATE CSE 2017 Set 2 | Question: 36
The pre-order traversal of a binary search tree is given by $12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20$. Then the post-order traversal of this tree is $2, 6, 7, 8, 9, 10, 12, 15, 16, 17, 19, 20$ $2, 7, 6, 10, 9, 8, 15, 17, 20, 19, 16, 12$ $7, 2, 6, 8, 9, 10, 20, 17, 19, 15, 16, 12$ $7, 6, 2, 10, 9, 8, 15, 16, 17, 20, 19, 12$
Arjun
asked
in
DS
Feb 14, 2017
by
Arjun
8.6k
views
gatecse-2017-set2
data-structures
binary-search-tree
69
votes
13
answers
62
GATE CSE 2017 Set 2 | Question: 55
Consider the following C program. #include<stdio.h> #include<string.h> int main() { char* c="GATECSIT2017"; char* p=c; printf("%d", (int)strlen(c+2[p]-6[p]-1)); return 0; } The output of the program is _______
Madhav
asked
in
Programming in C
Feb 14, 2017
by
Madhav
27.6k
views
gatecse-2017-set2
programming-in-c
numerical-answers
array
pointers
103
votes
7
answers
63
GATE CSE 2017 Set 1 | Question: 36
Consider the C functions foo and bar given below: int foo(int val) { int x=0; while(val > 0) { x = x + foo(val--); } return val; } int bar(int val) { int x = 0; while(val > 0) { x ... in: Return of $6$ and $6$ respectively. Infinite loop and abnormal termination respectively. Abnormal termination and infinite loop respectively. Both terminating abnormally.
Arjun
asked
in
Programming in C
Feb 14, 2017
by
Arjun
25.2k
views
gatecse-2017-set1
programming-in-c
programming
normal
recursion
47
votes
11
answers
64
GATE CSE 2017 Set 1 | Question: 35
Consider the following two functions. void fun1(int n) { if(n == 0) return; printf("%d", n); fun2(n - 2); printf("%d", n); } void fun2(int n) { if(n == 0) return; printf("%d", n); ... printf("%d", n); } The output printed when $\text{fun1}(5)$ is called is $53423122233445$ $53423120112233$ $53423122132435$ $53423120213243$
Arjun
asked
in
Programming in C
Feb 14, 2017
by
Arjun
20.2k
views
gatecse-2017-set1
programming
normal
tricky
recursion
38
votes
7
answers
65
GATE CSE 2017 Set 1 | Question: 20
Let $T$ be a tree with $10$ vertices. The sum of the degrees of all the vertices in $T$ is ________
Arjun
asked
in
DS
Feb 14, 2017
by
Arjun
18.7k
views
gatecse-2017-set1
data-structures
tree
easy
numerical-answers
86
votes
7
answers
66
GATE CSE 2017 Set 1 | Question: 13
Consider the following C code: #include<stdio.h> int *assignval (int *x, int val) { *x = val; return x; } void main () { int *x = malloc(sizeof(int)); if (NULL == x) return; x = assignval (x,0); ... and not as shown. compiles successfully but execution may result in dangling pointer. compiles successfully but execution may result in memory leak.
Arjun
asked
in
Programming in C
Feb 14, 2017
by
Arjun
35.2k
views
gatecse-2017-set1
programming-in-c
programming
pointers
33
votes
10
answers
67
GATE CSE 2017 Set 1 | Question: 6
Let $T$ be a binary search tree with $15$ nodes. The minimum and maximum possible heights of $T$ are: Note: The height of a tree with a single node is $0$. $4$ and $15$ respectively. $3$ and $14$ respectively. $4$ and $14$ respectively. $3$ and $15$ respectively.
Arjun
asked
in
DS
Feb 14, 2017
by
Arjun
16.6k
views
gatecse-2017-set1
data-structures
binary-search-tree
easy
25
votes
7
answers
68
GATE CSE 2017 Set 2 | Question: 54
Consider the following C program. #include<stdio.h> int main () { int m=10; int n, n1; n=++m; n1=m++; n--; --n1; n-=n1; printf(“%d”, n); return 0; } The output of the program is ______
Madhav
asked
in
Programming in C
Feb 14, 2017
by
Madhav
11.8k
views
gatecse-2017-set2
programming-in-c
numerical-answers
easy
35
votes
11
answers
69
GATE CSE 2017 Set 2 | Question: 13
A circular queue has been implemented using a singly linked list where each node consists of a value and a single pointer pointing to the next node. We maintain exactly two external pointers FRONT and REAR pointing to the front node and the rear node of the queue, respectively ... to the front node. (I) only. (II) only. Both (I) and (II). Neither (I) nor (II).
Madhav
asked
in
DS
Feb 14, 2017
by
Madhav
27.3k
views
gatecse-2017-set2
data-structures
queue
30
votes
11
answers
70
GATE CSE 2017 Set 2 | Question: 14
Consider the following function implemented in C: void printxy(int x, int y) { int *ptr; x=0; ptr=&x; y=*ptr; *ptr=1; printf(“%d, %d”, x, y); } The output of invoking $printxy(1,1)$ is: $0, 0$ $0, 1$ $1, 0$ $1, 1$
Madhav
asked
in
Programming in C
Feb 14, 2017
by
Madhav
9.6k
views
gatecse-2017-set2
programming-in-c
identify-function
pointers
26
votes
3
answers
71
GATE CSE 2017 Set 2 | Question: 2
Match the following: ... ; R-i; S-iii P-ii; Q-i; R-iv; S-iii P-ii; Q-iv; R-iii; S-i P-iii; Q-iv; R-i; S-ii
khushtak
asked
in
Programming in C
Feb 14, 2017
by
khushtak
5.8k
views
gatecse-2017-set2
programming
programming-in-c
match-the-following
1
vote
0
answers
72
GATE CSE 1988 | Question: 8iv
Consider the following Ada program: Procedure P is BAD-FORMAT: exception Procedure Q is begin ... if S/='b' then raise BAD-FORMAT end if; ... end Q; Procedure R is begin Q; exception when BAD-Format => ... handler body 1 end R; begin ... when BAD-FORMAT => ... handler body 2 end P; Under what conditions are the two handler bodies $1$ and $2$ executed?
go_editor
asked
in
Programming in C
Dec 19, 2016
by
go_editor
499
views
gate1988
normal
descriptive
programming
ada
out-of-gate-syllabus
0
votes
0
answers
73
GATE CSE 1988 | Question: 8iii
Write a LISP function to compute the product of all the numbers in a list. Assume that the list contains only number.
go_editor
asked
in
Programming in C
Dec 19, 2016
by
go_editor
452
views
gate1988
descriptive
programming
lisp
out-of-gate-syllabus
4
votes
2
answers
74
GATE CSE 1988 | Question: 8ii
Consider the two program segments below: for i:=1 to f(x) by 1 do S end i:=1; While i<=f(x) do S i:=i+1 end Under what conditions are these two programs equivalent? Treat $S$ as any sequence of statements and $f$ as a function.
go_editor
asked
in
Programming in C
Dec 19, 2016
by
go_editor
2.3k
views
gate1988
programming
descriptive
loop-invariants
14
votes
3
answers
75
GATE CSE 1988 | Question: 7iii
Consider the tree given in the below figure, insert $13$ and show the new balance factors that would arise if the tree is not rebalanced. Finally, carry out the required rebalancing of the tree and show the new tree with the balance factors on each mode.
go_editor
asked
in
DS
Dec 19, 2016
by
go_editor
3.1k
views
gate1988
normal
descriptive
data-structures
binary-tree
6
votes
2
answers
76
GATE CSE 1988 | Question: 7ii
Mark the balance factor of each node on the tree given in the below figure and state whether it is height-balanced.
go_editor
asked
in
DS
Dec 19, 2016
by
go_editor
2.1k
views
gate1988
data-structures
normal
descriptive
avl-tree
binary-tree
8
votes
2
answers
77
GATE CSE 1988 | Question: 7i
Define the height of a binary tree or subtree and also define a height-balanced (AVL) tree.
go_editor
asked
in
DS
Dec 19, 2016
by
go_editor
1.6k
views
gate1988
normal
descriptive
data-structures
binary-tree
8
votes
1
answer
78
GATE CSE 1988 | Question: 6ii
Below figure is the flow-chart corresponding to a program to calculate the $\gcd$ of two integers, $M$ and $N$ respectively, $(M, N >0).$ Use assertions at the cut point $C_1$, $C_2$ and $C_3$ to prove that the flow-chart is correct.
go_editor
asked
in
Programming in C
Dec 19, 2016
by
go_editor
1.5k
views
gate1988
normal
descriptive
loop-invariants
0
votes
0
answers
79
GATE CSE 1988 | Question: 2xiv
Which of the following features are available in Ada? procedures, monitors, packages, common statement, goto statement, generic unit tasks, backtracking, recursion, exceptions, pragmas, classes.
go_editor
asked
in
Programming in C
Dec 19, 2016
by
go_editor
469
views
gate1988
programming
descriptive
ada
out-of-gate-syllabus
0
votes
1
answer
80
GATE CSE 1988 | Question: 2xiii
What is referential transparency?
go_editor
asked
in
Programming in C
Dec 19, 2016
by
go_editor
610
views
gate1988
normal
descriptive
programming-languages
out-of-gate-syllabus
Page:
« prev
1
2
3
4
5
6
7
8
9
...
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