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
67
votes
4
answers
261
GATE CSE 2006 | Question: 13
A scheme for storing binary trees in an array $X$ is as follows. Indexing of $X$ starts at $1$ instead of $0$. the root is stored at $X[1]$. For a node stored at $X[i]$, the left child, if any, is stored in $X[2i]$ and the right child, if any, in $X[2i+1]$. To be able to store any binary tree on n vertices the minimum size of $X$ should be $\log_2 n$ $n$ $2n+1$ $2^n-1$
Rucha Shelke
asked
in
DS
Sep 17, 2014
by
Rucha Shelke
17.1k
views
gatecse-2006
data-structures
binary-tree
normal
55
votes
6
answers
262
GATE CSE 2003 | Question: 90
Consider the function $f$ defined below. struct item { int data; struct item * next; }; int f(struct item *p) { return ((p == NULL) || (p->next == NULL)|| ((p->data <= p ->next -> data) && f(p- ... order of data value the elements in the list are sorted in non-increasing order of data value not all elements in the list have the same data value
Kathleen
asked
in
DS
Sep 17, 2014
by
Kathleen
17.5k
views
gatecse-2003
data-structures
linked-list
normal
39
votes
5
answers
263
GATE CSE 2003 | Question: 89
Consider the C program shown below: #include<stdio.h> #define print(x) printf("%d", x) int x; void Q(int z) { z+=x; print(z); } void P(int *y) { int x = *y + 2; Q(x); *y = x - 1; print(x); } main(void) { x = 5; P(&x); print(x); } The output of this program is: $12 \ 7 \ 6$ $22 \ 12 \ 11$ $14 \ 6 \ 6$ $7 \ 6 \ 6$
Kathleen
asked
in
Programming in C
Sep 17, 2014
by
Kathleen
12.4k
views
gatecse-2003
programming
programming-in-c
normal
pointers
2
votes
2
answers
264
GATE CSE 2003 | Question: 75
Consider the following class definitions in a hypothetical Object Oriented language that supports inheritance and uses dynamic binding. The language should not be assumed to be either Java or C++, though the syntax is similar. Class P { Class Q subclass of P { void f(int ... P. The output produced by executing the above program fragment will be 1 2 1 2 1 1 2 1 2 2 2 2
Kathleen
asked
in
Programming in C
Sep 17, 2014
by
Kathleen
5.5k
views
gatecse-2003
programming
variable-binding
normal
out-of-syllabus-now
40
votes
5
answers
265
GATE CSE 2003 | Question: 73
The following program fragment is written in a programming language that allows global variables and does not allow nested declarations of functions. global int i=100, j=5; void P(x) { int i=10; print(x+10); i=200; j=20; print (x); } main() {P(i ... by need parameter passing mechanism, the values printed by the above program are: $115, 220$ $25, 220$ $25, 15$ $115, 105$
Kathleen
asked
in
Programming in C
Sep 17, 2014
by
Kathleen
9.2k
views
gatecse-2003
compiler-design
normal
runtime-environment
parameter-passing
5
votes
0
answers
266
GATE CSE 2003 | Question: 71
Consider the following logic program P $\begin{align*} A(x) &\gets B(x,y), C(y) \\ &\gets B(x,x) \end{align*}$ ... $(\forall x) [(\forall y) [B(x,y) \land C(y)] \Rightarrow A(x)] \land (\exists x)[B(x,x)]$
closed
Kathleen
asked
in
Programming in C
Sep 17, 2014
by
Kathleen
3.8k
views
gatecse-2003
programming
logic-programming
out-of-syllabus-now
89
votes
12
answers
267
GATE CSE 2003 | Question: 64
Let S be a stack of size $n \geq1$. Starting with the empty stack, suppose we push the first n natural numbers in sequence, and then perform $n$ pop operations. Assume that Push and Pop operations take $X$ seconds each, and $Y$ seconds elapse between the end of one such ... S. The average stack-life of an element of this stack is $n(X+Y)$ $3Y+2X$ $n(X+Y)-X$ $Y+2X$
Kathleen
asked
in
DS
Sep 17, 2014
by
Kathleen
30.8k
views
gatecse-2003
data-structures
stack
normal
65
votes
4
answers
268
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
Kathleen
asked
in
DS
Sep 17, 2014
by
Kathleen
20.2k
views
gatecse-2003
data-structures
easy
isro2009
binary-search-tree
38
votes
4
answers
269
GATE CSE 2003 | Question: 24
Which of the following statements is FALSE? In statically typed languages, each variable in a program has a fixed type In un-typed languages, values do not have any types In dynamically typed languages, variables have no types In all statically typed languages, each variable in a program is associated with values of only a single type during the execution of the program
Kathleen
asked
in
Programming in C
Sep 16, 2014
by
Kathleen
9.0k
views
gatecse-2003
programming
normal
type-checking
25
votes
3
answers
270
GATE CSE 2003 | Question: 19, ISRO2009-24
Suppose the numbers $7, 5, 1, 8, 3, 6, 0, 9, 4, 2$ ... $9 \ 8 \ 6 \ 4 \ 2 \ 3 \ 0 \ 1 \ 5 \ 7$
Kathleen
asked
in
DS
Sep 16, 2014
by
Kathleen
23.4k
views
gatecse-2003
binary-search-tree
easy
isro2009
81
votes
6
answers
271
GATE CSE 2003 | Question: 6
Let $T(n)$ be the number of different binary search trees on $n$ distinct elements. Then $T(n) = \sum_{k=1}^{n} T(k-1)T(x)$, where $x$ is $n-k+1$ $n-k$ $n-k-1$ $n-k-2$
Kathleen
asked
in
DS
Sep 16, 2014
by
Kathleen
22.2k
views
gatecse-2003
normal
binary-search-tree
72
votes
4
answers
272
GATE CSE 2003 | Question: 2
Assume the following C variable declaration: int *A[10], B[10][10]; Of the following expressions: $A[2]$ $A[2][3]$ $B[1]$ $B[2][3]$ which will not give compile-time errors if used as left hand sides of assignment statements in a C program? I, II, and IV only II, III, and IV only II and IV only IV only
Kathleen
asked
in
Programming in C
Sep 16, 2014
by
Kathleen
29.9k
views
gatecse-2003
programming
programming-in-c
easy
pointers
44
votes
5
answers
273
GATE CSE 2006 | Question: 10
In a binary max heap containing $n$ numbers, the smallest element can be found in time $O(n)$ $O(\log n)$ $O(\log \log n)$ $O(1)$
Rucha Shelke
asked
in
DS
Sep 16, 2014
by
Rucha Shelke
20.7k
views
gatecse-2006
data-structures
binary-heap
easy
24
votes
2
answers
274
GATE CSE 2002 | Question: 11
The following recursive function in C is a solution to the Towers of Hanoi problem. void move(int n, char A, char B, char C) { if (......................) { move (.............................); printf("Move disk %d from pole %c to pole %c\n", n, A, C); move (.....................); } } Fill in the dotted parts of the solution.
Kathleen
asked
in
Programming in C
Sep 15, 2014
by
Kathleen
3.2k
views
gatecse-2002
programming
recursion
descriptive
20
votes
1
answer
275
GATE CSE 2002 | Question: 6
Draw all binary trees having exactly three nodes labeled $A, B$ and $C$ on which preorder traversal gives the sequence $C, B, A$.
Kathleen
asked
in
DS
Sep 15, 2014
by
Kathleen
2.5k
views
gatecse-2002
data-structures
binary-tree
easy
descriptive
35
votes
3
answers
276
GATE CSE 2002 | Question: 2.18
The C language is: A context free language A context sensitive language A regular language Parsable fully only by a Turing machine
Kathleen
asked
in
Programming in C
Sep 15, 2014
by
Kathleen
10.1k
views
gatecse-2002
programming
programming-in-c
normal
101
votes
7
answers
277
GATE CSE 2002 | Question: 2.12
A weight-balanced tree is a binary tree in which for each node, the number of nodes in the left sub tree is at least half and at most twice the number of nodes in the right sub tree. The maximum possible height (number of nodes on the path from the root to the furthest ... which of the following? $\log_2 n$ $\log_{\frac{4}{3}} n$ $\log_3 n$ $\log_{\frac{3}{2}} n$
Kathleen
asked
in
DS
Sep 15, 2014
by
Kathleen
23.3k
views
gatecse-2002
data-structures
binary-tree
normal
35
votes
5
answers
278
GATE CSE 2002 | Question: 2.9
The number of leaf nodes in a rooted tree of n nodes, with each node having $0$ or $3$ children is: $\frac{n}{2}$ $\frac{(n-1)}{3}$ $\frac{(n-1)}{2}$ $\frac{(2n+1)}{3}$
Kathleen
asked
in
DS
Sep 15, 2014
by
Kathleen
30.8k
views
gatecse-2002
data-structures
tree
normal
38
votes
4
answers
279
GATE CSE 2002 | Question: 2.8
Consider the following declaration of a two-dimensional array in C: char $a[100][100]$; Assuming that the main memory is byte-addressable and that the array is stored starting from memory address $0$, the address of $a [40][50]$ is: $4040$ $4050$ $5040$ $5050$
Kathleen
asked
in
Programming in C
Sep 15, 2014
by
Kathleen
27.7k
views
gatecse-2002
programming-in-c
programming
easy
13
votes
2
answers
280
GATE CSE 2002 | Question: 1.18
The results returned by function under value-result and reference parameter passing conventions Do not differ Differ in the presence of loops Differ in all cases May differ in the presence of exception
Kathleen
asked
in
Programming in C
Sep 15, 2014
by
Kathleen
8.2k
views
gatecse-2002
programming
parameter-passing
normal
out-of-syllabus-now
Page:
« prev
1
...
9
10
11
12
13
14
15
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