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

I forgot my password
Activity
Questions
Unanswered
Tags
Subjects
Users
Ask
Prev
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
0
votes
0
answers
1
DataStructureDeQueue
Suppose a dequeue is stored in a circular array with N memory cells. At which of the following condition is the dequeue is full? (i) LEFT = N and RIGHT = 1 (ii) LEFT = RIGHT + 1 (iii) LEFT = 1 and RIGHT = N (iv) LEFT = RIGHT  1 + N (i) and (iii) (iii) and (iv) (ii) and (iii) (i) and (iv)
asked
45 minutes
ago
in
DS
by
Abhisek Tiwari 4
Active
(
3.9k
points)

5
views
0
votes
0
answers
2
self doubt
somewhere we seen that formula How many binary tree possible without labeled =c(2n,n)/n+1. anybody explain how we get this formula.
asked
1 day
ago
in
DS
by
sandeep singh gaur
(
187
points)

28
views
#binary
tree
+2
votes
6
answers
3
GATE201946
Let $T$ be a full binary tree with $8$ leaves. (A full binary tree has every level full.) Suppose two leaves $a$ and $b$ of $T$ are chosen uniformly and independently at random. The expected value of the distance between $a$ and $b$ in $T$ (ie., the number of edges in the unique path between $a$ and $b$) is (rounded off to $2$ decimal places) _________.
answered
4 days
ago
in
DS
by
pratekag
(
455
points)

3.9k
views
gate2019
numericalanswers
datastructure
binarytree
0
votes
1
answer
4
MCA ARRAY ADDRESS CALCULATION
Find the address of the position [10, 11, 12] of array A in column major order? Given Dimension is A[1:10, 5:15, 10:15], w is two word count, and Base address is 200.
answered
4 days
ago
in
DS
by
omprakash889
(
23
points)

22
views
0
votes
1
answer
5
ARRAY
A Sorted array of n elements contains 0 and 1 to find out majority of 0 and 1.How much time it will take??? and please explain Meaning majority of 0 and 1??
answered
5 days
ago
in
DS
by
Priyadrasta Raut
(
345
points)

54
views
#array
0
votes
1
answer
6
NIELIT 201854
______ to evaluate an expression without any embedded function calls. Two stacks are required one stack is needed Three stacks are required More than three stacks are required
answered
6 days
ago
in
DS
by
Priyadrasta Raut
(
345
points)

22
views
nielit2018
stack
expressionevaluation
+25
votes
10
answers
7
GATE2007IT28
Consider a hash function that distributes keys uniformly. The hash table size is $20$. After hashing of how many keys will the probability that any new key hashed collides with an existing one exceed $0.5$. $5$ $6$ $7$ $10$
answered
Feb 16
in
DS
by
saurav raghaw
Active
(
1k
points)

4.8k
views
gate2007it
datastructure
hashing
probability
normal
+27
votes
5
answers
8
GATE2014341
Consider the pseudocode given below. The function $DoSomething()$ takes as argument a pointer to the root of an arbitrary tree represented by the $leftMostChildrightSibling$ representation. Each node of the tree is of type $treeNode$. typedef struct treeNode* treeptr; ... tree. height of the tree. number of nodes without a right sibling in the tree. number of leaf nodes in the tree
answered
Feb 15
in
DS
by
blackcloud
(
15
points)

4.3k
views
gate20143
datastructure
trees
normal
+2
votes
1
answer
9
How many Binary Search Trees are possible for a labelled nodes?
Let us there are n nodes which are labelled. Then the number of trees possible is given by the Catalan Number i.e $\binom{2n}{n} / (n+1)$ Then the binary search trees possible is just 1?
answered
Feb 14
in
DS
by
teja1521
(
139
points)

83
views
algorithms
graphtheory
binarysearchtree
binarysearch
binarytree
trees
datastructure
0
votes
3
answers
10
ternary tree
In a ternary tree the number of internal nodes of degree 1,2 and 3 is 4,3 and 3 respectively.The number of leaf nodes in the ternary is a)12 b)11 c)9 d)10
answered
Feb 10
in
DS
by
Sanjay Sharma
Veteran
(
50.5k
points)

151
views
0
votes
2
answers
11
GATE201940
Consider the following statements: The smallest element in a maxheap is always at a leaf node The second largest element in a maxheap is always a child of a root node A maxheap can be constructed from a binary search tree in $\theta(n)$ time A binary search tree can be ... time Which of te above statements are TRUE? I, II and III I, II and IV I, III and IV II, III and IV
answered
Feb 9
in
DS
by
Tuhin Dutta
Loyal
(
9.1k
points)

1.9k
views
gate2019
datastructure
heap
+13
votes
3
answers
12
GATE20183
A queue is implemented using a noncircular singly linked list. The queue has a head pointer and a tail pointer, as shown in the figure. Let $n$ denote the number of nodes in the queue. Let 'enqueue' be implemented by inserting a new node at the head, and 'dequeue' be implemented by deletion ... $\theta(1), \theta(1)$ $\theta(1), \theta(n)$ $\theta(n), \theta(1)$ $\theta(n), \theta(n)$
answered
Feb 5
in
DS
by
Viplav Patil
(
49
points)

3k
views
gate2018
algorithms
datastructure
queues
normal
linkedlists
+1
vote
1
answer
13
gate 2019
Consider the following statements. (i) In max Heap smallest element is at the leaf node. (ii) In max Heap second largest element always the child of root. (iii) Binary search tree can be constructed from max heap in θ(n). (iv) Max Heap can be build from Binary search tree in θ(n) Which of the above ... ) and (iii) (b) (i), (ii) and (iv) (c) (ii), (iii) and (iv) (d) (i), (iii) and (iv)
answered
Feb 5
in
DS
by
Yash Soni 1
(
177
points)

593
views
+2
votes
4
answers
14
Number of nodes in heap of height 'h'
The number of nodes of height $h$ in any $n$element heap is ________. $h$ $2^{h}$ ceil $\left[\frac{n}{2^{h}}\right]$ ceil $\left[\frac{n}{2^{h+1}}\right]$ Answer is given as D, But I think it should be C. Because, even if you take height=1 then possible nodes are 3 and 2.
answered
Feb 2
in
DS
by
SivarajeshA
(
305
points)

2.4k
views
datastructure
binarytree
binaryheap
0
votes
0
answers
15
test series
asked
Jan 31
in
DS
by
saif
(
427
points)

35
views
0
votes
0
answers
16
ME MOCK 2
We are given a C function, mystery() as follows. void mystery(int m, int n) { while(m<=n) { m++; n; } } Let X be the number of times the comparission inside the while loop ( i.e., m<=n ) is performed, when mystery(127,255) is called. Then the value of X is _______________
asked
Jan 30
in
DS
by
himgta
Active
(
3.6k
points)

69
views
algorithms
+21
votes
7
answers
17
GATE2017120
Let $T$ be a tree with $10$ vertices. The sum of the degrees of all the vertices in $T$ is ________
answered
Jan 30
in
DS
by
Suneel Padala
Junior
(
735
points)

3.8k
views
gate20171
datastructure
trees
numericalanswers
+1
vote
1
answer
18
If the average depth of a node in an nnode binary search tree is O(lg n), then the height of the tree is
answered
Jan 28
in
DS
by
_sonu
(
221
points)

218
views
binarytree
datastructure
0
votes
1
answer
19
Made easy tree height
The height of a binary tree is defined as the number of nodes in the longest path from root to the leaf node. Let X be the height of a complete binary tree with 256 nodes. Then the value of X will be Answer 9
answered
Jan 28
in
DS
by
_sonu
(
221
points)

48
views
datastructure
binarytree
0
votes
0
answers
20
Made easy test series hashing
Consider the hashing table with 'm' slots and 'n' keys. If the expected number of probes in unsuccessful search is 3. The expected number of probes in a successful search is_ Answer 1.647
asked
Jan 27
in
DS
by
Ram Swaroop
Active
(
2.3k
points)

80
views
madeeasytestseries
hashing
probability
datastructure
+1
vote
0
answers
21
made easy test
The number of permutations can be obtained in the output using stack assuming that input contains elements 1, 2, 3, 4, 5, 6 in any order such that 3 will poped out from stack at 3rd position are _______ (assume one element enter in stack only one time).
asked
Jan 26
in
DS
by
pream sagar
Active
(
1.7k
points)

142
views
+1
vote
2
answers
22
GATEBOOK2019 Mock Test128
If the expression $((2 + 3) * 4 + 5 * (6 + 7) * 8) + 9$ is evaluated with $*$ having precedence over $+$, then the value obtained is the same as the value of which of the following prefix expressions? $+ + * + 2 3 4 * * 5 + 6 7 8 9$ $+ * + + 2 3 4 * * 5 + 6 7 8 9$ $* + + 2 3 4 * * 5 + + 6 7 8 9$ $* + + + 2 3 4 * * 5 + 6 7 8 9$
answered
Jan 26
in
DS
by
Mk Utkarsh
Boss
(
34.1k
points)

125
views
gb2019mock1
stack
prefixnotation
0
votes
0
answers
23
Quora
In a directed graph, a path is called special if every subpath of the path is shortest path. Subpath of a path P means every path in the path P, except P. A. Every shortest path is special B. Every special path is shortest
asked
Jan 25
in
DS
by
Cpt.Nemo143
(
47
points)

20
views
0
votes
0
answers
24
Binary Tree
I think its answer is 8 .Please ,can any one make it sure for me :)
asked
Jan 25
in
DS
by
Nandkishor3939
Active
(
1.2k
points)

45
views
datastructure
binarytree
0
votes
0
answers
25
Number of sub graphs possible
Number of labelled subgraphs possible for the graph given below______________
asked
Jan 25
in
DS
by
Nandkishor3939
Active
(
1.2k
points)

65
views
graphtheory
datastructure
+30
votes
7
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
Jan 24
in
DS
by
dharmesh7
Active
(
1.1k
points)

4.2k
views
gate2006it
datastructure
binarytree
normal
+1
vote
3
answers
27
selfdoubt
Consider a binary tree T that has 50 leaf nodes. Then the number of nodes in T that have exactly ONE children are ______.
answered
Jan 24
in
DS
by
askeshavas
(
157
points)

92
views
binarytree
+1
vote
1
answer
28
BINARY TREE
A rooted tree with 8 nodes has its nodes [1.....8] in preorder.When the tree is traversed in postorder.....nodes visited are {3,5,4,2,7,8,6,1}. Draw a tree for it. How to solve .....someone please explain?
answered
Jan 24
in
DS
by
Badayayash
Junior
(
879
points)

130
views
binarytree
datastructure
0
votes
1
answer
29
GATEBOOK2019 Mock Test153
Suppose that six keys are inserted into an unbalanced binary search tree in the following order: $4, 6, 3, 8, 2,5$ Which of the following statements is/are TRUE? Finding a key in the resulting tree requires examining $1, 2$ or $3$ nodes. The resulting ... be inserted without adding another level to the tree. I and II only I and III only II and III only I, II, and III
answered
Jan 23
in
DS
by
Ashwani Kumar 2
Boss
(
14.9k
points)

69
views
gb2019mock1
binarysearchtree
+20
votes
8
answers
30
GATE199819b
Compute the post fix equivalent of the following expression $3^*\log(x+1)\frac{a}{2}$
answered
Jan 22
in
DS
by
Swami patil
Junior
(
759
points)

2.8k
views
gate1998
stack
infixpostfix
0
votes
0
answers
31
Gate cs 2017
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, ... node to front. We dont need to do this. So why B is the correct answer?D should be correct ? please explain.
asked
Jan 22
in
DS
by
sadiashafaque
(
21
points)

17
views
#g
usergate2017
usermod
#queue
0
votes
0
answers
32
Stack
Q.A stack based CPU executes the instruction.Memory location 500 contains 0x88 and memory location 700 contains 0x37.The stack pointer is at 0x003F. The instructions are as follows: I1:PUSH 500 I2:PUSH 700 I3:ADD I4:POP 600 I5:PUSH 300 Which of ... Memory location 0x40 contain 0x88 after execution instructions c)Memory location 600 contains 0xBF after execution instructions d)Both (a) and (c)
asked
Jan 20
in
DS
by
Badayayash
Junior
(
879
points)

55
views
madeeasytestseries
stack
datastructure
0
votes
1
answer
33
made easy test
The number of labelled subgraphs possible for the graph given below.
answered
Jan 20
in
DS
by
balchandar reddy san
Active
(
2.7k
points)

214
views
madeeasytestseries
discretemathematics
graphtheory
+1
vote
0
answers
34
GATEBOOK2019 Mock Test113
A $kary$ tree is a tree in which every node has at most $k$ children. In a $kary$ tree with $n$ nodes and height $h,$ which of the following is an upper bound for the maximum number of leaves as a function of $h, k,$ and $n?$ $\log_{k}n$ $\log_{k}h$ $\frac{n}{\log_{k}n}$ $k^{h}$
asked
Jan 19
in
DS
by
GATEBOOK
Boss
(
15.3k
points)

93
views
gb2019mock1
trees
+2
votes
0
answers
35
GATEBOOK2019 Mock Test124
Which of these statements is not true about an AVL tree T containing n nodes? Rotations may be required during key insertion to keep T balanced. The height of T cannot exceed $1.5 * \log_2n$. The number of interior nodes in T cannot exceed the ... of that node's subtree, then T can be used to perform order statistic searches in O(lg n) asymptotic algorithmic complexity.
asked
Jan 19
in
DS
by
GATEBOOK
Boss
(
15.3k
points)

143
views
gb2019mock1
avltree
0
votes
0
answers
36
GATEBOOK2019 Mock Test154
If Tree1 and Tree2 are the trees given below, which traversals of Tree1 and Tree2, respectively, will produce the same sequence of node names? preorder & postorder postorder & inorder postorder & postorder inorder & inorder
asked
Jan 19
in
DS
by
GATEBOOK
Boss
(
15.3k
points)

55
views
gb2019mock1
treetraversal
+37
votes
8
answers
37
GATE201053
A hash table of length $10$ uses open addressing with hash function $h(k) = k \: mod \: 10$, and linear probing. After inserting $6$ values into an empty hash table, the table is shown as below $0$ $1$ $2$ $42$ $3$ $23$ $4$ $34$ $5$ ... insertion sequences of the key values using the same hash function and linear probing will result in the hash table shown above? $10$ $20$ $30$ $40$
answered
Jan 18
in
DS
by
Nitesh Singh 2
Active
(
1.6k
points)

5.5k
views
datastructure
hashing
difficult
gate2010
+23
votes
6
answers
38
GATE2014312
Consider the following rooted tree with the vertex labeled $P$ as the root: The order in which the nodes are visited during an inorder traversal of the tree is $SQPTRWUV$ $SQPTUWRV$ $SQPTWUVR$ $SQPTRUWV$
answered
Jan 18
in
DS
by
Nitesh Singh 2
Active
(
1.6k
points)

3.2k
views
gate20143
datastructure
trees
easy
0
votes
2
answers
39
#Push & #Pop
A queue is implemented using two stacks S1 and S2. Initially the queue contains 1, 2, 3, 4 from front to rear. The following operations are performed in the queue: delete, insert (5), delete, Then how many total no. of push and pop operations are needed to perform the above operation? a) Push: 12 Pop: 13 b) Push: 15 Pop: 16 c) Push: 11 Pop: 10 d) Push: 12 Pop: 11
answered
Jan 18
in
DS
by
Priyadrasta Raut
(
345
points)

192
views
datastructure
stack
queue
0
votes
1
answer
40
# stacks
How many enqueue and dequeue operations are required to perform a pop operation if Q1 contains n element initially?
answered
Jan 18
in
DS
by
Priyadrasta Raut
(
345
points)

23
views
stack
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
Recent Posts
Need suggestions for what to do next after Gate ??
For GATECSE Admissions 2019
Challenge to GATE keys: Question 26, If you also want to challenge the same, as I did!
How to follow Standard Textbooks?
Gate contest link is now open
All categories
General Aptitude
1.5k
Engineering Mathematics
7.1k
Digital Logic
2.7k
Programming & DS
4.9k
Programming
3.6k
DS
1.3k
Algorithms
4.2k
Theory of Computation
5.3k
Compiler Design
2.1k
Operating System
4k
Databases
4k
CO & Architecture
3.5k
Computer Networks
4k
Non GATE
1.4k
Others
1.5k
Admissions
559
Exam Queries
555
Tier 1 Placement Questions
23
Job Queries
69
Projects
18
Follow @csegate
Recent questions and answers in DS
Recent Blog Comments
Congrats Mamta! I saw your interview on...
Well it is quite nostalgic for me as if I have...
See in recent posts "For GATE CSE Admissions 2019"
which ppt are you referring to, can you share the...
I am not a ranker so you might not believe on my...
47,935
questions
52,336
answers
182,393
comments
67,819
users