The Gateway to Computer Science Excellence
For all GATE CSE Questions
Toggle navigation
GATE Overflow
Facebook Login
Google Login
or
Email or Username
Password
Remember
Login
Register

I forgot my password
All Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Previous
Blogs
New Blog
Exams
First time here? Checkout the
FAQ
!
x
×
Close
Use the google search bar on side panel. It searches through all previous GATE/other questions. For hardcopy of previous year questions please see
here
Recent questions and answers in DS
+15
votes
5
answers
1
GATE2017236
The preorder traversal of a binary search tree is given by $12, 8, 6, 2, 7, 9, 10, 16, 15, 19, 17, 20$. Then the postorder 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$
answered
13 hours
ago
in
DS
by
manikantsharma
(
139
points)

2k
views
gate20172
datastructure
binarysearchtree
0
votes
0
answers
2
#DS Inserting elements into Min Heap?
The number of distinct min heap are possible with keys 1, 2, 3, 4, 5 are ________. I know, there are variance of this question for Max heap and even for Min heap, the answer won't change, but I just wanna know if my technique is right or not. ===== ... any value. > Lastly the right sub tree => 1C1 = 1 Totally  1*4C3*1*2*1 = 8. Is this approach correct?
asked
22 hours
ago
in
DS
by
iarnav
Loyal
(
7.3k
points)

22
views
algorithms
binaryheap
heap
datastructure
0
votes
0
answers
3
#DS Min Heaps Possible?
The number of possible minheaps containing each value from {1,1,1,1,1,1,1} exactly once is _______ This is a variance of Gate 2018 question and how will we deal if all values are same?
asked
23 hours
ago
in
DS
by
iarnav
Loyal
(
7.3k
points)

20
views
algorithms
binaryheap
datastructure
0
votes
2
answers
4
Number of comparison in the Sorted list
Suppose there are 4 sorted list of 16 elements each. If we merge these lists into a single sorted list of 64 elements. The key comparisons that are needed in the worst case using an efficient algorithm are ________.
answered
1 day
ago
in
DS
by
Anu007
Boss
(
17k
points)

22
views
algorithms
sorting
0
votes
1
answer
5
SelfDoubt
What is the timecomplexity of Enqueue and Dequeue operations when Queue is implemented using linked list? What is the time complexity of inserting a element in single linked list ?
answered
3 days
ago
in
DS
by
Anil Ji
Active
(
1.5k
points)

69
views
0
votes
1
answer
6
#DataStructure Heaps Self Doubt.
In a binary Heap of 100 elements time taken to find the 99th element? or in a binary heap on "n" elements, time taken to find (n1)th element? Note ; I'm not asking about smallest or largest, but simply the 99th element.
answered
3 days
ago
in
DS
by
Deepakk Poonia (Dee)
Boss
(
13.2k
points)

84
views
algorithms
heap
0
votes
1
answer
7
#Binary Max Heap Question (Doubt)
Let's say we're given with a MAX Heap and we want to delete any of the leaf node, then how much time will it take to delete any of the leaf node and maintain the max heap property? My main doubt is  will it O(n) time to reach to leaf nodes?
answered
5 days
ago
in
DS
by
Deepakk Poonia (Dee)
Boss
(
13.2k
points)

57
views
binaryheap
heap
+28
votes
7
answers
8
GATE19941.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$, nonzero elements, (i.e elements of lower triangle) of each row are stored one after another, starting from the first row, the index of the ... new representation is: $i+j$ $i+j1$ $(j1)+\frac{i(i1)}{2}$ $i+\frac{j(j1)}{2}$
answered
6 days
ago
in
DS
by
Shubhgupta
Junior
(
669
points)

3.6k
views
gate1994
datastructure
arrays
normal
0
votes
1
answer
9
depth first traversal
answered
6 days
ago
in
DS
by
Shaik Masthan
Active
(
2.5k
points)

35
views
0
votes
2
answers
10
data structure
To remove recursion from a program we have to use which of the following data structure? array stack queue list
answered
Jun 18
in
DS
by
Anil Ji
Active
(
1.5k
points)

53
views
datastructure
recursion
stack
0
votes
1
answer
11
ds wrk book
Assume that there are two lower triangular matrices $A$ and $B$ of size $n*n$. If matrix $A$ and transpose of $B$ are fit into a rectangular matrix $C$ of size $n*(n+1)$, then $B[i,j]=C[i,j+1]$ $B[i,j]=C[j+1,i]$ $B[i,j]=C[j, i+1]$ I m getting $c$ .is it correct???
answered
Jun 18
in
DS
by
Anil Ji
Active
(
1.5k
points)

22
views
0
votes
1
answer
12
Heapsort Comparisons
How many element comparisons would heap sort use to sort the integers $1$ to $8$ if they were initially in sorted order, initially in reverse sorted order?
answered
Jun 17
in
DS
by
Kaluti
Loyal
(
5.4k
points)

41
views
datastructure
heapsort
0
votes
0
answers
13
Heaps
What is the recurrence relation / math expression for the number of binary min heaps possible with "n" elements on which "k" elements are repeated "t" times where t=2 to n?
asked
Jun 17
in
DS
by
Balaji Jegan
Active
(
1.1k
points)

13
views
heap
datastructure
+2
votes
2
answers
14
data structure
answered
Jun 16
in
DS
by
Deepakk Poonia (Dee)
Boss
(
13.2k
points)

79
views
+14
votes
2
answers
15
GATE199911b
Write a constant time algorithm to insert a node with data $D$ just before the node with address $p$ of a singly linked list.
answered
Jun 13
in
DS
by
janeb abhishek
(
291
points)

366
views
gate1999
datastructure
linkedlists
0
votes
1
answer
16
#DataStructure Time Complexity in Sorted Array.
answered
Jun 12
in
DS
by
Lakshay Kakkar
Junior
(
909
points)

56
views
algorithms
timecomplexity
arrays
datastructure
+17
votes
2
answers
17
GATE200937,ISRODEC201755
What is the maximum height of any AVLtree with $7$ nodes? Assume that the height of a tree with a single node is $0$. $2$ $3$ $4$ $5$
answered
Jun 12
in
DS
by
Mudrakola Karthik 3
(
85
points)

5.9k
views
gate2009
datastructure
binarysearchtree
normal
isrodec2017
+25
votes
2
answers
18
GATE20125
The worst case running time to search for an element in a balanced binary search tree with $n2^{n}$ elements is $\Theta(n\log n)$ $\Theta(n2^n)$ $\Theta(n)$ $\Theta(\log n)$
answered
Jun 12
in
DS
by
Mudrakola Karthik 3
(
85
points)

2k
views
gate2012
datastructure
normal
binarysearchtree
+15
votes
2
answers
19
GATE201343
The preorder traversal sequence of a binary search tree is $30, 20, 10, 15, 25, 23, 39, 35, 42$. Which one of the following is the postorder traversal sequence of the same tree? $10, 20, 15, 23, 25, 35, 42, 39, 30$ $15, 10, 25, 23, 20, 42, 35, 39, 30$ $15, 20, 10, 23, 25, 42, 35, 39, 30$ $15, 10, 23, 25, 20, 35, 42, 39, 30$
answered
Jun 12
in
DS
by
Mudrakola Karthik 3
(
85
points)

1.4k
views
gate2013
datastructure
binarysearchtree
normal
+15
votes
3
answers
20
GATE2006IT45
Suppose that we have numbers between $1$ and $100$ in a binary search tree and want to search for the number $55$. Which of the following sequences CANNOT be the sequence of nodes examined? $\{10, 75, 64, 43, 60, 57, 55\}$ $\{90, 12, 68, 34, 62, 45, 55\}$ $\{9, 85, 47, 68, 43, 57, 55\}$ $\{79, 14, 72, 56, 16, 53, 55\}$
answered
Jun 12
in
DS
by
Mudrakola Karthik 3
(
85
points)

3.2k
views
gate2006it
datastructure
binarysearchtree
normal
+18
votes
4
answers
21
GATE2005IT55
A binary search tree contains the numbers $1, 2, 3, 4, 5, 6, 7, 8.$ When the tree is traversed in preorder and the values in each node printed out, the sequence of values obtained is $5, 3, 1, 2, 4, 6, 8, 7.$ If the tree is traversed in postorder, the sequence obtained would be $8, 7, 6, 5, 4, 3, 2, 1$ $1, 2, 3, 4, 8, 7, 6, 5$ $2, 1, 4, 3, 6, 7, 8, 5$ $2, 1, 4, 3, 7, 8, 6, 5$
answered
Jun 12
in
DS
by
Mudrakola Karthik 3
(
85
points)

1.9k
views
gate2005it
datastructure
binarysearchtree
normal
+15
votes
2
answers
22
GATE200319, ISRO200924
Suppose the numbers $7, 5, 1, 8, 3, 6, 0, 9, 4, 2$ are inserted in that order into an initially empty binary search tree. The binary search tree uses the usual ordering on natural numbers. What is the inorder traversal sequence of the resultant tree? $7 \ 5 \ 1 \ 0 \ 3 \ 2 \ 4 \ 6 \ 8 \ 9$ $0 ... \ 1 \ 2 \ 3 \ 4 \ 5 \ 6 \ 7 \ 8 \ 9$ $9 \ 8 \ 6 \ 4 \ 2 \ 3 \ 0 \ 1 \ 5 \ 7$
answered
Jun 12
in
DS
by
Mudrakola Karthik 3
(
85
points)

1.9k
views
gate2003
binarysearchtree
easy
isro2009
+1
vote
1
answer
23
UGCNETNov2017iii20
Heap allocation is required for languages that: A. Use dynamic scope rules B. Support dynamic data structures C. Support recursion D. Support recursion and dynamic data structures
answered
Jun 11
in
DS
by
Prasanjeet Ghosh
Active
(
1.3k
points)

53
views
ugcnetnov2017iii
+54
votes
9
answers
24
GATE2016141
Let $Q$ denote a queue containing sixteen numbers and $S$ be an empty stack. $Head(Q)$ returns the element at the head of the queue $Q$ without removing it from $Q$. Similarly $Top(S)$ returns the element at the top of $S$ without removing it from $S$. Consider ... Pop(S); Enqueue (Q, x); end end The maximum possible number of iterations of the while loop in the algorithm is _______.
answered
Jun 10
in
DS
by
janeb abhishek
(
291
points)

5.5k
views
gate20161
datastructure
queues
difficult
numericalanswers
0
votes
0
answers
25
self doubt
if we know that the inorder of a balanced binary search tree is in ascending order, than can we say that the tym complexity to find this is O(1)??????
asked
Jun 8
in
DS
by
eyeamgj
Active
(
2.4k
points)

33
views
+28
votes
5
answers
26
GATE2006IT9
In a binary tree, the number of internal nodes of degree $1$ is $5$, and the number of internal nodes of degree $2$ is $10$. The number of leaf nodes in the binary tree is $10$ $11$ $12$ $15$
answered
Jun 8
in
DS
by
janeb abhishek
(
291
points)

2.9k
views
gate2006it
datastructure
binarytree
normal
0
votes
2
answers
27
ACE TEST SERIES QUESTION
answered
Jun 6
in
DS
by
Shaik Masthan
Active
(
2.5k
points)

118
views
acetestseries
binarytree
0
votes
1
answer
28
ACE Test Series Question
Suppose a stack $S$. Which is empty initially consider the following code: int values[] = {1, 3, 5, 7, 9, 11, 13, 15, 17, 19}; for(int i=0; i<10; i++) { S.PUSH = (values[i]); } int n = 25; for (int i=0; i<4; i++) { n+= S.POP(); } for(int i=0; i<2; i++) { n= S.POP(); } printf("%d",n); The output of the program code is _________ .
answered
Jun 6
in
DS
by
Shaik Masthan
Active
(
2.5k
points)

76
views
datastructure
stack
programming
+1
vote
1
answer
29
Sorting
Which sorting algorithm is good if we already knew the range of number  Counting Sort OR Radix Sort
answered
Jun 5
in
DS
by
Sumeet Singh
Junior
(
501
points)

67
views
sorting
timecomplexity
algorithms
0
votes
0
answers
30
Number of Max Heap
How many maxheaps can be formed with the following elements? $\{1,1,1,2,2,2,3,3,3,4,4,4\}$
asked
Jun 4
in
DS
by
Balaji Jegan
Active
(
1.1k
points)

114
views
datastructure
permutationsandcombinations
binaryheap
heap
0
votes
1
answer
31
Made_Easy Test Series_2019
Consider a stack is used to evaluate fully parenthesized arithmetic expression from left to right. Each operand is placed on the stack and operators operate on top two elements of the stack. The minimum size of stack required to evaluate given expression is ________. (((2 × 5) + 6) – (4 × 3))
answered
May 31
in
DS
by
Tushar Patil
(
387
points)

58
views
0
votes
2
answers
32
DATA STRUCTURES
What is the difference between full binary tree ,almost complete binary tree and complete binary tree? explain by drawing trees
answered
May 29
in
DS
by
abhishekmehta4u
Boss
(
14.3k
points)

95
views
datastructure
binarytree
0
votes
2
answers
33
Binary Tree
$\text{Given preorder and inorder, how many binary trees are possible?}$
answered
May 26
in
DS
by
Deepakk Poonia (Dee)
Boss
(
13.2k
points)

97
views
datastructure
binarytree
+1
vote
1
answer
34
DS BINARY TREE
NUMBER OF BINARY TREE POSSIBLE WITH 3 UNLABELED NODES?
answered
May 26
in
DS
by
sanny_1
(
37
points)

93
views
datastructure
binarytree
+3
votes
2
answers
35
Datastructres
The number of distinct max heap are possible with keys 1, 2, 3, 4, 5 are ________.
answered
May 26
in
DS
by
OO7
(
153
points)

132
views
binaryheap
heap
algorithms
datastructure
0
votes
1
answer
36
Interpretation of Array dimensions
What is the correct interpretation of an $array[a][b][c]$? I have solved questions where $a$ is the number of layers, $b$ number of rows and $c$ number of columns. I have also seen questions where $a$ is the number of rows, $b$ is columns and $c$ is layers. Which one to follow to solve questions in GATE exam?
answered
May 24
in
DS
by
Anil Ji
Active
(
1.5k
points)

58
views
arrays
datastructure
+1
vote
1
answer
37
GATE CS Mock 2018
Suppose there are two singly linked lists both of which intersect at some point and become a single linked list. The head or start pointers of both the lists are known, but the intersecting node and lengths of lists are not known. What is worst case time complexity of optimal ... n), where m, n are lengths of given lists D) Θ(min(n, m)), where m, n are lengths of given lists
answered
May 22
in
DS
by
abhishekmehta4u
Boss
(
14.3k
points)

91
views
usergate2018
usermod
0
votes
0
answers
38
Reema Thareja
Is reema thareja a suitable book for GATE Data structures?
asked
May 21
in
DS
by
mohitjarvissharma
(
115
points)

65
views
programminginc
datastructure
0
votes
0
answers
39
Data Structures Resource
Hello everyone. Can anyone suggest me a good book for Data Structures for GATE. Horowitz and Weiss are available in .chm format and its really difficult to read from them. Any other suggestions. Also, I have a good knowledge of C, but i have to formally study it for GATE. Any suggestions for this too?
asked
May 21
in
DS
by
mohitjarvissharma
(
115
points)

38
views
datastructure
programminginc
0
votes
1
answer
40
AVL Tree
Minimum number of internal nodes in an AVL tree with height 5? Please give a standard procedure that can be applied to larger heights as well. I know the formula: S(h) = S(h1) + S(h2) + 1, but here it is asked for internal nodes only. Drawing a tree is tedious.
answered
May 16
in
DS
by
Ananya Jaiswal 1
Active
(
1.6k
points)

48
views
avltree
tree
To see more, click for all the
questions in this category
.
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
Members at the site
Subham Nagar
piya
Anil Ji
Tushar Patil
Lakshay Kakkar
Soumya29
naniraj
Ruturaj Mohanty
prachigupta
the fallen bat
MRINMOY_HALDER
Recent Posts
IISc CSA and CDCS written test and interview Experince
IIIT Hyderabad Interview Experience
My failure, Oh wait SUCCESS journey
ALGORITHMS CHECKLIST:
A Failure who got into IISc
All categories
General Aptitude
1.3k
Engineering Mathematics
5.2k
Digital Logic
2k
Programming & DS
3.7k
Programming
2.7k
DS
994
Algorithms
3.2k
Theory of Computation
4k
Compiler Design
1.6k
Operating System
2.8k
Databases
3k
CO & Architecture
2.6k
Computer Networks
3k
Non GATE
1k
Others
1.3k
Admissions
487
Exam Queries
436
Tier 1 Placement Questions
18
Job Queries
56
Projects
9
Follow @csegate
Gatecse
Recent questions and answers in DS
Recent Blog Comments
@Arjun Sir Can I pay money today(25 june 2018) ...
Sir I didn't get an email for GO classroom, ...
any one with marks less than 125 selected?
Thank you @Arjun Sir, @NamitaAIR1, @Priyanka, ...
Your story is very inspiring for the boys like me ...
36,196
questions
43,650
answers
124,100
comments
42,939
users