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
37
votes
3
answers
161
GATE CSE 1994 | Question: 21
Consider the following recursive function: function fib (n:integer);integer; begin if (n=0) or (n=1) then fib := 1 else fib := fib(n-1) + fib(n-2) end; The above function is run on a computer with a stack of $64$ bytes. Assuming ... an address takes $2$ bytes each, estimate the maximum value of $n$ for which the stack will not overflow. Give reasons for your answer.
Kathleen
asked
in
Programming in C
Oct 5, 2014
by
Kathleen
25.5k
views
gate1994
programming
recursion
normal
descriptive
35
votes
3
answers
162
GATE CSE 1994 | Question: 8
A rooted tree with $12$ nodes has its nodes numbered $1$ to $12$ in pre-order. When the tree is traversed in post-order, the nodes are visited in the order $3, 5, 4, 2, 7, 8, 6, 10, 11, 12, 9, 1$. Reconstruct the original tree from this information, that is, find the parent of each node, and show the tree diagrammatically.
Kathleen
asked
in
DS
Oct 5, 2014
by
Kathleen
7.2k
views
gate1994
data-structures
binary-tree
normal
descriptive
17
votes
3
answers
163
GATE CSE 1994 | Question: 5
A $3-\text{ary}$ tree is a tree in which every internal node has exactly three children. Use induction to prove that the number of leaves in a $3-\text{ary}$ tree with $n$ internal nodes is $2(n+1)$.
Kathleen
asked
in
DS
Oct 5, 2014
by
Kathleen
12.9k
views
gate1994
data-structures
tree
proof
descriptive
35
votes
4
answers
164
GATE CSE 1994 | Question: 1.17, UGCNET-Sep2013-II: 32
Linked lists are not suitable data structures for which one of the following problems? Insertion sort Binary search Radix sort Polynomial manipulation
Kathleen
asked
in
DS
Oct 4, 2014
by
Kathleen
23.0k
views
gate1994
data-structures
linked-list
normal
ugcnetsep2013ii
33
votes
6
answers
165
GATE CSE 1994 | Question: 1.14
Which of the following permutations can be obtained in the output (in the same order) using a stack assuming that the input is the sequence $\text{1, 2, 3, 4, 5}$ in that order? $\text{3, 4, 5, 1, 2}$ $\text{3, 4, 5, 2, 1}$ $\text{1, 5, 2, 3, 4}$ $\text{5, 4, 3, 1, 2}$
Kathleen
asked
in
DS
Oct 4, 2014
by
Kathleen
33.1k
views
gate1994
data-structures
stack
normal
75
votes
11
answers
166
GATE CSE 1994 | Question: 1.11
In a compact single dimensional array representation for lower triangular matrices (i.e all the elements above the diagonal are zero) of size $n \times n$, non-zero elements, (i.e elements of lower triangle) of each row are stored one after another, starting from the first row, the index of the ... is: $i+j$ $i+j-1$ $(j-1)+\frac{i(i-1)}{2}$ $i+\frac{j(j-1)}{2}$
Kathleen
asked
in
DS
Oct 4, 2014
by
Kathleen
28.1k
views
gate1994
data-structures
array
normal
22
votes
2
answers
167
GATE CSE 1994 | Question: 1.5
An unrestricted use of the "$goto$" statement is harmful because it makes it more difficult to verify programs it increases the running time of the programs it increases the memory required for the programs it results in the compiler generating longer machine code
Kathleen
asked
in
Programming in C
Oct 4, 2014
by
Kathleen
3.8k
views
gate1994
programming
easy
goto
23
votes
3
answers
168
GATE CSE 2010 | Question: 52
A hash table of length $10$ uses open addressing with hash function $h(k) = k \mod 10$, and linear probing. After inserting $6$ ... $34, 42, 23, 52, 33, 46$ $46, 34, 42, 23, 52, 33$ $42, 46, 33, 23, 34, 52$
go_editor
asked
in
DS
Sep 30, 2014
by
go_editor
6.6k
views
gatecse-2010
data-structures
hashing
normal
41
votes
2
answers
169
GATE CSE 2010 | Question: 36
The following C function takes a singly-linked list as input argument. It modifies the list by moving the last element to the front of the list and returns the modified list. Some part of the code is left blank. typedef struct node { int value; struct node *next; ... $q \rightarrow next = NULL; p \rightarrow next = head; head = p$;
go_editor
asked
in
DS
Sep 30, 2014
by
go_editor
10.8k
views
gatecse-2010
data-structures
linked-list
normal
19
votes
2
answers
170
GATE CSE 1993 | Question: 16
Prove by the principal of mathematical induction that for any binary tree, in which every non-leaf node has $2$-descendants, the number of leaves in the tree is one more than the number of non-leaf nodes.
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
2.9k
views
gate1993
data-structures
binary-tree
normal
descriptive
14
votes
4
answers
171
GATE CSE 1993 | Question: 13
Consider a singly linked list having $n$ nodes. The data items $d_1, d_2, \dots d_n$ are stored in these $n$ nodes. Let $X$ be a pointer to the $j^{\text{th}}$ node $(1 \leq j \leq n)$ in which $d_j$ is stored. A new data item $d$ stored ... insert $d$ into the list to obtain a list having items $d_1, d_2, \dots, d_{j}, d,\dots, d_n$ in order without using the header.
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
3.6k
views
gate1993
data-structures
linked-list
normal
descriptive
26
votes
2
answers
172
GATE CSE 1993 | Question: 12
The following Pascal program segments finds the largest number in a two-dimensional integer array $A[0\dots n-1, 0\dots n-1]$ using a single loop. Fill up the boxes to complete the program and write against $\fbox{A}, \fbox{B}, \fbox{C} \text{ and } \fbox{D}$ in your answer ... A[i, j]>max then max:=A[i, j]; if |C| then j:=j+1; else begin j:=0; i:=|D| end end end
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
4.9k
views
gate1993
data-structures
array
normal
descriptive
23
votes
3
answers
173
GATE CSE 1997 | Question: 18
Consider the following piece of 'C' code fragment that removes duplicates from an ordered list of integers. Node *remove-duplicates (Node* head, int *j) { Node *t1, *t2; *j=0; t1 = head; if (t1! = NULL) t2 = t1 ->next ... statements marked $S2$ get executed? What is the significance of the value in the integer pointed to by $j$ when the function completes?
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
4.7k
views
gate1997
data-structures
linked-list
normal
descriptive
28
votes
2
answers
174
GATE CSE 1997 | Question: 17
An array $A$ contains $n \geq 1$ positive integers in the locations $A[1], A[2], \dots A[n]$. The following program fragment prints the length of a shortest sequence of consecutive elements of $A$, $A[i], A[i+1], \dots,A[j]$ ... ◻ end else begin if(j-i) < min then min:=j-i; sum:=sum -A[i]; i:=i+1; end writeln (min +1); end.
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
5.0k
views
gate1997
data-structures
array
normal
descriptive
22
votes
3
answers
175
GATE CSE 1997 | Question: 16
A size-balanced binary tree is a binary tree in which for every node the difference between the number of nodes in the left and right subtree is at most $1$. The distance of a node from the root is the length of the path from the root to the ... height $h \geqslant 1$, how many nodes are at distance $h-1$ from the root? Write only the answer without any explanations.
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
5.0k
views
gate1997
data-structures
binary-tree
normal
descriptive
proof
54
votes
6
answers
176
GATE CSE 1997 | Question: 12
Consider a hash table with $n$ buckets, where external (overflow) chaining is used to resolve collisions. The hash function is such that the probability that a key value is hashed to a particular bucket is $\frac{1}{n}$. The hash table is initially ... in any of the $K$ insertions? What is the probability that the first collision occurs at the $K^{th}$ insertion?
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
10.5k
views
gate1997
data-structures
hashing
probability
normal
descriptive
4
votes
1
answer
177
GATE CSE 1997 | Question: 10
Consider the following program in Pseudo-Pascal syntax. program what: var z: integer procedure recur(x): begin if x <= 40 then begin x:x+z recur(x); z:=x+10 end end(*recur*) begin(*what*) z=10; recur(z); writeln(z) end ... by program? How many times is ‘recur’ called? What value is printed by the program if the parameter is passed by reference?
Kathleen
asked
in
Programming in C
Sep 29, 2014
by
Kathleen
2.1k
views
gate1997
programming
parameter-passing
normal
out-of-syllabus-now
45
votes
6
answers
178
GATE CSE 1997 | Question: 6.2
Let $G$ be the graph with $100$ vertices numbered $1$ to $100$. Two vertices $i$ and $j$ are adjacent if $\vert i-j \vert =8$ or $\vert i-j \vert=12$. The number of connected components in $G$ is $8$ $4$ $12$ $25$
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
8.8k
views
gate1997
data-structures
normal
graph-theory
56
votes
5
answers
179
GATE CSE 1997 | Question: 4.7
A priority queue $Q$ is used to implement a stack that stores characters. PUSH (C) is implemented as INSERT $(Q, C, K)$ where $K$ is an appropriate integer key chosen by the implementation. POP is implemented as ... For a sequence of operations, the keys chosen are in non-increasing order non-decreasing order strictly increasing order strictly decreasing order
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
24.3k
views
gate1997
data-structures
stack
normal
priority-queue
48
votes
7
answers
180
GATE CSE 1997 | Question: 4.5
A binary search tree contains the value $1, 2, 3, 4, 5, 6, 7, 8$. The tree is traversed in pre-order and the values are printed out. Which of the following sequences is a valid output? $5 \ 3 \ 1 \ 2 \ 4 \ 7 \ 8 \ 6$ $5 \ 3 \ 1 \ 2 \ 6 \ 4 \ 8 \ 7$ $5 \ 3 \ 2 \ 4 \ 1 \ 6 \ 7 \ 8$ $5 \ 3 \ 1 \ 2 \ 4 \ 7 \ 6 \ 8$
Kathleen
asked
in
DS
Sep 29, 2014
by
Kathleen
37.3k
views
gate1997
data-structures
binary-search-tree
normal
Page:
« prev
1
...
4
5
6
7
8
9
10
11
12
13
14
...
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